complete TODO's using Java
Q: When utilising recursion to solve a problem, why does the recursive function have to call itself to…
A: Why is it necessary for the recursive function to call itself? Recursion is a widely used topic in…
Q: What distinguishes TPC from SPEC in terms of its focus?
A: TPC and SPEC: The Transaction Procession Council (TPC) is a non-profit organization that creates…
Q: Explain why you think a web server is the end system.
A: Introduction: A web server is a computer that is dedicated to the operation of websites. Online…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: The Answer start from step-2.
Q: 1-The following program is supposed to add the contents of memory location 8000 h to the Accumulator…
A: Solution 1) The program is written here for carry Only , so we have to write for sum too The…
Q: Define the three essential phases of testing that you have experienced when working on a commercial…
A: Introduction: Software testing needs that testers pay careful attention to the tiniest details in…
Q: A virtual machine is perceived differently by the operating system and a user programme. What are…
A: A virtual machine's perceptions The operating system manages all virtual machines and is aware of…
Q: m and how can you e
A: Introduction A database management system (DBMS) is a system for managing data that must remain…
Q: Where and how do regions and availability zones come into play in order to improve application…
A: Introduction: The purpose of this question is to describe how regions and availability zones are…
Q: What distinguishes a quantum computer from a traditional computer?
A: Introduction: Nowadays, traditional computers are being used that’s works on the machine code i.e.,…
Q: Question 6 Construct a Turing Machine that takes a binary string and changes every 1 in the string…
A: Turing Machine that takes a binary string and changes every 1 in it to a 0, and only first 0 to 1…
Q: For simplicity, let us assume that a file block is located at the address 581132 on the disc. What…
A: In this question we have to understand how the file block are located and stored in the disc. Lets…
Q: Assume you're pitching your users on the data warehouse concept. For them, how would you define…
A: Introduction: Multidimensional data analysis is a strategy in which, in response to management…
Q: Write a Python function that creates a csv file that includes a price list of user-entered items.…
A: In this programming question we have to execute a program in python This program we have to write to…
Q: The Elements of Style by William Strunk, Jr. and E. B. White is a popular style guide. There are…
A: Introduction: The goal of this book is to summaries the most important aspects of plain English…
Q: how a company may defend itself against hackers entering into its network and stealing confidential…
A: Educate your team: Guaranteeing your staff comprehends organization security conventions and how to…
Q: 7.19 Tabulate the PLA programming table for the four Boolean functions listed below. Minimize the…
A:
Q: Identify invalid variables names from the following lists. Justify your answer. i) Student name…
A: The invalid keyword are as follows: double,student name,currency$,2number,3456. Below is the…
Q: [A] Using Hamming codes, find the codeword corresponding to the message (100110111011]? (Use odd…
A:
Q: Write a program that computes the cost of a long distance call. The cost of the call is determined…
A: program that computes the cost of a long-distance call
Q: Design a turing machine which would accept the language: L = { ww: w is a subset of {a, b}* }
A: The answer of this question is as:
Q: Explain why you think a web server is the end system.
A: Web server: An explanation of a web server may be regarded the ultimate system. The final system is…
Q: Lohat is tht lecolion and „Ru rome of 4e viv.kual memovy pagling in windouas ?
A: Page file for Windows: Virtual memory, represented by the windows page file, is used in the same way…
Q: Find a "one-of-a-kind" article on how Big Data allows businesses to track vast volumes of personal…
A: Introduction: Large data collections that surpass basic databases and data processing…
Q: What is routeing, exactly, and how does it function in reality are questions that need to be…
A: Routing is how a page is moved from one to another. Developers may create a Single Page Application…
Q: What is the mechanism of a wi-fi evildirect attack? At all costs, avoid using handwritten notes…
A: Introduction: Core Security security researchers claim to have discovered a Denial of Service (DoS)…
Q: Explain why you think a web server is the end system.
A: Web server are the end system because , firstly end systems include PCs, workstations, Web servers,…
Q: Write an application that throws and catches an ArithmeticException when you attempt to take the…
A: Math.sqrt() returns the square root of a value of type double passed to it as argument.
Q: In multimedia, standard construction components are critical. Explain the different types of…
A: Introduction: Text, audio, graphics, video, and animation are all examples of multimedia components.…
Q: Is there a distinction between multiprogramming and multithreading?
A: There is a distinction between multithreading and multiprogramming. Let's see the difference between…
Q: What would happen if the referential integrity of a database was compromised? What are the most…
A: Referential integrity: It is the term used to describe the relationship between tables.Because each…
Q: What exactly is voting technology and why is it so crucial? In terms of computer networking, what…
A: Introduction: Punched cards, optical scan voting equipment, and customized voting kiosks, to mention…
Q: 9.13 LAB: Thesaurus Python Given a set of text files containing synonyms for different words,…
A: ANSWER:-
Q: Is it feasible to remove and add items to a linked list? Explain.
A: Linked List is a collection of nodes where each node stores the reference of next node
Q: Isn't it possible to use a Parent Class object in a Child Class and take use of all of its features?
A: Introduction: Object and classes are the concept in object oriented programming languages. Through…
Q: Microkernels try to make the kernel as tiny as feasible by placing a lot of the operating system…
A: Introduction: It's the first element of the operating system to load, and it stays in main memory…
Q: Describe the system's design requirements.
A: Given Question: Describe the design requirements for the system.
Q: What are the most critical decisions to be made when it comes to physical database design and how do…
A: The first step to take in physical database design is to estimate the size and usage patterns of the…
Q: Lohat is 4he lecolion and fle name viv-kual memory Paging in windows ?
A: Windows paging file: The window makes the same use of virtual memory, represented by the windows…
Q: Why is it so important that a backup of drive C isn't kept on a different partition on the same hard…
A: Introduction: Various filesystems may be installed for different types of files thanks to…
Q: Jogging burns 3.9 calories per minute. Write a python program that uses a loop to display (in a…
A: logic:- iterate from i=5 to i<=60 display i and (i*3.9) increment i value by 5 end loop
Q: Why do we speak of a reduction in the output's visual quality when rasterizing?
A: Rasterizing: Photoshop turns a vector layer to pixels when you rasterize it. When you zoom in on a…
Q: Java Computer Programming, make the deliverables fit into one program
A: public class Main{ static int computerOddSum(int [] array){ int sum = 0; // initalize sum to 0 for…
Q: Explain how does the capacity analysis react when many processes are running concurrently?
A: Please find the answer and detailed explanation in the following steps.
Q: John the farmer has tasked his son with collecting the eggs from the chicken coop each morning and…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: Computer peripherals are external devices that improve the machine's functionality by providing…
A: Ans a: The key concerns that should be considered when designing a parallel I/O port are data…
Q: 5.7 Convert 4571s to Binary.
A: 5.7 In numeral system, we know octal is base-8 and binary is base-2. To convert octal 4571 to…
Q: what Can ue oon about Paformona optimitadion Prom Amdaht's law?
A:
Q: def homeworkgrade(assingment): gradesum = 0 hlist = [] for k in range(assignment): grade =…
A: The above method accept the number of assignments . Suppose i have 5 assignments of 100 marks in…
Q: array, 3> values; The above 2D array has how many rows? O b. 5 O d. 4 O c. 2 O a. 3
A: Given in first question is a way of making a 2D array in c++.
complete TODO's using Java
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Create Pseudocode for this class Queue { private static int front, rear, capacity; private static int queue[]; Queue(int c) { front = rear = 0; capacity = c; queue = new int[capacity]; } static void queueEnqueue(int data) { if (capacity == rear) { System.out.printf("\nQueue is full\n"); return; } else { queue[rear] = data; rear++; } return; } static void queueDequeue() { if (front == rear) { System.out.printf("\nQueue is empty\n"); return; } else { for (int i = 0; i < rear - 1; i++) { queue[i] = queue[i + 1]; } if (rear < capacity) queue[rear] = 0; rear--; } return; } static void queueDisplay() { int i; if (front == rear) { System.out.printf("\nQueue is Empty\n"); return; } for (i = front; i < rear; i++) { System.out.printf(" %d <-- ", queue[i]); } return; } static void queueFront() { if (front == rear) { System.out.printf("\nQueue is Empty\n"); return; } System.out.printf("\nFront…class Queue { private static int front, rear, capacity; private static int queue[]; Queue(int size) { front = rear = 0; capacity = size; queue = new int[capacity]; } // insert an element into the queue static void queueEnqueue(int item) { // check if the queue is full if (capacity == rear) { System.out.printf("\nQueue is full\n"); return; } // insert element at the rear else { queue[rear] = item; rear++; } return; } //remove an element from the queue static void queueDequeue() { // check if queue is empty if (front == rear) { System.out.printf("\nQueue is empty\n"); return; } // shift elements to the right by one place uptil rear else {…1. Implement the “missing” front and rear operations in JAVA using constructor and Also write output: class Queue { private int maxSize; private long[] queArray; private int front; private int rear; private int nItems; public Queue(int s) // constructor { maxSize = s; queArray = new long[maxSize]; front = 0; rear = -1; nItems = 0; } // public void insert(long j) { // put item at rear of queue // public long remove() { // take item from front of queue //And then return } // public long peekFront() { // peek at front of queue //Return queue array front } // public boolean isEmpty(){ // true if queue is empty //return nItems zero } // public boolean isFull() { // true if queue is full return } // public int size() // number of items in queue { //return nItems; } // } // end class Queue //////////////////////////////////////////////////////////////// class QueueApp { public static void main(String[] args) { Queue theQueue = new Queue(5); // queue holds 5 items…
- Code in java please import java.util.*;public class QueueLastname //<------ change the name of the class to include yourlast name{// no code goes here}class Queue{private ArrayList<String> q;public Queue( ){q = new ArrayList<String>();}public void enqueue(String num){q.add(num);}public String dequeue(){return q.remove(0);}/*This method goes through the quque and finds the longest name in the qThe queue must be restored in its original state after finding the longestname*/public String getLongestName(){Stack s = new Stack();String longest = q.get(0);// q.remove(0);boolean b = false;while(!b){try{String front = q.get(0);//get the first elementq.remove(0);//remove it from the qs.push(front);// push it to the stackif (front.length() > longest.length() )longest = front;}catch(Exception e){b = true;}}restore(s); // restoring the queuereturn longest; }/*Traverse through the queue and creates a string containing all the names.must restore the quque to its original…please convert this into c++ import java.util.Iterator;import java.util.NoSuchElementException; public class Queue<Item> implements Iterable<Item> { private int n; // number of elements on queue private Node first; // beginning of queue private Node last; // end of queue // helper linked list class private class Node { private Item item; private Node next; } /** * Initializes an empty queue. */ public Queue() { first = null; last = null; n = 0; } /** * Returns true if this queue is empty. * * @return {@code true} if this queue is empty; {@code false} otherwise */ public boolean isEmpty() { return first == null; } /** * Returns the number of items in this queue. * * @return the number of items in this queue */ public int size() { return n; } /** * Returns the number of items in this queue. * * @return the…#include <iostream> usingnamespace std; class Queue { int size; int* queue; public: Queue(){ size = 0; queue = new int[100]; } void add(int data){ queue[size]= data; size++; } void remove(){ if(size ==0){ cout <<"Queue is empty"<<endl; return; } else{ for(int i =0; i < size -1; i++){ queue[i]= queue[i +1]; } size--; } } void print(){ if(size ==0){ cout <<"Queue is empty"<<endl; return; } for(int i =0; i < size; i++){ cout<<queue[i]<<" <- "; } cout << endl; } //your code goes here }; int main(){ Queue q1; q1.add(42); q1.add(2); q1.add(8); q1.add(1); Queue q2; q2.add(3); q2.add(66); q2.add(128); q2.add(5); Queue q3 = q1+q2; q3.print();…
- Given a partial main() and PlaneQueue class, write the push() and pop() methods for PlaneQueue. Then complete the main() to read in whether flights are arriving or have landed at an airport. An "arriving" flight is pushed onto the queue. A "landed" flight is popped from the front of the queue. Output the queue after each plane is pushed or popped. Entering -1 exits the program. Ex: If the input is: arriving AA213 arriving DAL23 arriving UA628 landed -1 the output is: Air-traffic control queue Next to land: AA213 Air-traffic control queue Next to land: AA213 Arriving flights: DAL23 Air-traffic control queue Next to land: AA213 Arriving flights: DAL23 UA628 AA213 has landed. Air-traffic control queue Next to land: DAL23 Arriving flights: UA628 JAVA Please/** Iluustration of RecursiveTask*/import java.util.concurrent.ExecutionException;import java.util.concurrent.ForkJoinPool;import java.util.concurrent.RecursiveTask; public class SumWithPool{ public static void main(String[] args) throws InterruptedException, ExecutionException { //get the number of avaialbe CPUs int nThreads = Runtime.getRuntime().availableProcessors(); System.out.println("Available CPUs: " + nThreads); //create an array of data int n = 10; //initital data size if(args.length > 0) // use the user given data size n = Integer.parseInt(args[0]); int[] numbers = new int[n]; for(int i = 0; i < numbers.length; i++) { numbers[i] = i; } ForkJoinPool forkJoinPool = new ForkJoinPool(nThreads); Sum s = new Sum(numbers,0,numbers.length); long startTime = System.currentTimeMillis(); //start timer Long result = forkJoinPool.invoke(s); long endTime =…c++ a Queue Class that allows users to push strings or integer values into it. For example, when running the following code: SpecialQueue Q; Q.push("Albert"); Q.push("Jose"); Q.push(123); Q.pop(); Q.pop(); Q.pop(); The output should be: Albert Jose 123 Submit a TEXT file that contains your class. By class, I mean everything EXCEPT your main function. DO NOT SUBMIT YOUR MAIN().
- Java programming I have to do the "Resize method" which I believe if the array is full, it should resize so there is space. Ill paste the code below: package circularQueue; /* * Design the class that would implement the interfaceiQueue. */ public class cirQueue <T> implements iQueue <T> { //Array of T objects private T[] Ar; //reference to array of objects //int size keeps track of how many elements in the queue int size = 0; //first the index to the head of the queue int first = -1; //last the index the last element of the queue int last = -1; public cirQueue() { Ar = (T[]) new Object[5]; size = 0; first = last = -1; } public int size() { return size; } public boolean empty() { return (size == 0); } private void resize() { //HW TODO } //inserts element e at the back of the queue public void insert(T e) { if(this.empty()) { first = last = 0; //insert e at indx 0; Ar[first] = e; size = 1; return; } if(size == Ar.length) { //resize HW complete this one.…In java pls! here is some starter code for this problem: public class ThreadingDivisors { public static void main(String[] args) { long start = System.currentTimeMillis(); int maxDivisors = 0; int answer = 0; for (int n=1; n<100000; n++) { int divisors = getNumDivisors(n); if (divisors > maxDivisors) { maxDivisors = divisors; answer = n; } } System.out.println(answer + " has the most divisors (" + maxDivisors + ")"); long end = System.currentTimeMillis(); System.out.println(end - start + " milliseconds"); } public static int getNumDivisors(int n) { int numDivisors = 0; for (int i=1; i<=n; i++) { if (n % i == 0) { numDivisors++; } } return numDivisors; } }In the lecture we studied IntStack, a class that implements a static stack of integers. Write a template that will create a static stack of any data type. Demonstrate the class with a driver program. #pragma once class IntStack{private: int *stackArray; int stackSize; int top; public: IntStack(int size); void push(int num); void pop(int &num); bool isFull(); bool isEmpty();}; Queue Exceptions: Modify the static queue class provided in our lecture as follows. Make the isFull and isEmpty member functions private. Define a queue overflow exception and modify enqueue so that it throws this exception when the queue runs out of space. Define a queue underflow exception and modify dequeue so that it throws this exception when the queue is empty. Rewrite the main program so that it catches overflow exceptions when they occur. The exception handler for queue overflow should print an appropriate error message and then terminate the program. #include…