JAVA programming question i will attach images of the ourQueue code and the main I have to do the following: *create an ourQueue object, add the following sequence: *2,-3,4,-6,7,8,-9,-11 *create and ourStack object *write a program/ one loop that would result into the stack containing all of the negative number at the bottom and the positive numbers at the top. *outStack at the end should contain the following *[-3,-6,-9,-11,2,4,7,8]
Q: Create a JavaScript function expression that meets the following requirements: _spellCorrection( s...
A: Actually, program is an executable software that runs on a computer.
Q: Create a JavaScript function expression that meets the following requirements: _breakArray(array, ...
A: Actually, array is a collection of elements.
Q: Java Programming – Lesson 4 Using Methods – Laboratory Exercises 3. Create a class named Commission...
A: Code : public class Commission{ double sales, commRate;int comRate; public static double computeComm...
Q: Java Programming – Lesson 4 Using Methods – Laboratory Exercises 2. Create a class whose main() hol...
A: The code of this is in next step:
Q: Expalin with an illustration What is the necessity for software engineering? Given its significance ...
A: Introduction: Developing, designing, implementing, maintaining, and retiring software are all part o...
Q: Twisted pair cable (Ethernet) has how many pairs of wires? What is the name of the port on a compute...
A: Actually, computer is a electronic device which takes input and gives output.
Q: Privacy in the context of information security is a difficult concept to comprehend.'
A: Introduction: Private information regarding personally identifiable information is generally charact...
Q: List the different components of a computer system. You may also include list of the technical speci...
A: Let's see the solution in the next steps
Q: Write in the programming language SWI Prolog the following predicate: The intersection of two sets....
A: Here I am considering the example for simplification to find the intersection ([3,1,9,2] , [7,2,5,1,...
Q: Assume there are two SS CPUS in your system. To execute these two threads, how many cycles will it t...
A: Introduction: A thread's life cycle is comprised of many phases. For instance, a line is born, begin...
Q: What is the best indicator that a website is reliable?
A: What is the best indicator that a website is reliable?
Q: 4. Using the following sample relation and your knowledge of declarative constraints: STUDENT (Title...
A: Due to company policies I m compelled to solve only one question and that is the first question. The...
Q: Explain in detail what cloud computing is and what the advantages of utilising it are.
A: Cloud Computing- Cloud computing is an overall term for whatever includes conveying hosted services ...
Q: rns related to the digital divide and how are these being resolved? What are your thoughts on the di...
A: DIGITAL DIVIDE The digital divide is the difference in access to modern information and communicati...
Q: Write a MATLAB program that finds the sum for-25 to 5. (Increment by 5). By ,using (for loop)
A: Start Assign sum with 0 Run for loop -25 to 5 and every time increment by 5 print sum on console Sto...
Q: Explain the potential and benefits of an IoT-oriented strategy over an M2M-oriented approach by usin...
A: A more IoT-focused strategy has the following possibilities and advantages over a more M2M-focused o...
Q: 5. Imagine that you have been assigned to a team that will be developing an inventory tracking syste...
A: ANSWER:-
Q: Explain why it is critical in the construction of secure systems to keep track of what users are doi...
A: Introduction : It is necessary to assess the significance of logging user behaviors in the creation ...
Q: Classifications of computing applications and the characteristics of each are described in detail.
A: Introduction: Computer Application Types Computer applications and computer systems may be classifie...
Q: Use capital letters. What would be the equation of an AND gate if the inputs are A, B, and the outpu...
A: In Step 2, I have provided brief explanation about each gates ( AND , OR , NOT )------
Q: This function determines the amount of computer instructions required for each source-level statemen...
A: Introduction: Whatever your high-level programming language refers to as a "statement." Frequently,...
Q: When an optimistic approach to concurrency control is applied, it is common for transactions to take...
A: Introduction: When concurrency control takes an optimistic stance, In transactional systems, it ...
Q: Describe the process through which intra-AS routing is achieved. Give an example of a routing protoc...
A: An Autonomous System (AS) is an assortment of switches whose prefixes and steering arrangements are ...
Q: List the eight most important design principles for user interfaces. How would you rank them in term...
A: Eight fundamental rules for user interface design, ranked in order of importance.
Q: Discuss with aid of diagrams the purpose of the following devices in data communications. i)Hub ii) ...
A: answer is
Q: hat are lookahead sets? What will lookahead set consist if a rule alternative starts with token refe...
A: Lets see the solution.
Q: arn about the benefits and drawbacks of batch and online data input approaches. A demonstration of s...
A: Intro Compare and contrast the benefits and drawbacks of batch versus online data input methods. The...
Q: write VB 6.0 program to print ali, Date and time after each 3 sec and continue until stop the timer ...
A: Answer in step 2
Q: What is the most significant distinction between TLS and SSL? Why do web transmission protocols such...
A: Introduction: In order to protect online communications from illegal alteration, SSL and TLS (Transp...
Q: Q2. Write a C program to find the result of the following series by using power function. The progra...
A: You haven't done anything wrong. Your answers match the correct answers of the given sum. The answer...
Q: Can you explain the importance of interrupt in microprocessor?
A: Introduction: Interrupt is a technique for temporarily stopping the execution of a programme so that...
Q: {9, 10, 11, 12}⊆{10, 11, 12} true or false
A: Explanation Assume A = {9,10,11,12} and B= {10,11,12} A is the subset of B if all the elements of se...
Q: Laboratory Exercises – Java Lesson 5: Creating Classes and Objects 1 a . Create a class named Pizza...
A: JAVA Program: a) For Pizza Class: // Creating class named Pizzapublic class Pizza { // Data fields i...
Q: Regarding to "Intellectual Property". What do you think the impact would be on creative industries, ...
A: INTRODUCTION: Here we need to answer the impact would be on creative industries, such as music, movi...
Q: Define the term "machine language."
A: Introduction: Machine code, also called machine language, is the underlying language of computers an...
Q: As part of your introduction to engineering class's term project, make a PowerPoint presentation wit...
A: Introduction: If your introduction to engineering class includes a term project, create a PowerPoint...
Q: access advanced audit policy settings, what tool is used
A: A) Group Policy it is used to access advanced policy settings
Q: Describe the process by which skilled interface designers carry out their jobs.
A: Introduction: Interface Design: Device Architecture and User Experience, or UX, are influenced by in...
Q: Design the circuit with a decoder and external gates.
A:
Q: parent process. o ie. no grandchildren o Your process must clearly display that each forked process ...
A: Answer is in given below.
Q: Write a program that prints an nxn multiplication table, given a positive integer n. Input Each test...
A: Python Program: # Taking the number n as user inputn = int(input("Enter the number n: ")) # Display ...
Q: tion of WPA/WPA2 security ensures data cannot be read in transit? Message integrity Authentication ...
A: Below the function of WPA/WPA2 security ensures data cannot be read in transit
Q: Write a MATLAB program that finds the sum for-25 to 5. (Increment by 5). By using (for loop)
A: The question is to write Matlab code for the given question.
Q: Take a new smartphone and be excited about the apps available. You read about a great new phone game...
A: To download and install the gaming program, the user must agree to certain access permissions, such ...
Q: Define the concept of dynamic random access memory.
A: Introduction: Computer processors often require data or program code to work correctly, and dynamic ...
Q: Create a java code that the user will input a certain letter then identify a color that corresponds ...
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOTS--------------
Q: Write down two real-world scenarios for each of the following gadgets. Honeypot NIDS HIDS Biometr...
A: Introduction: Honeypot: The honeypot looks like a real computer system, with applications and data, ...
Q: In order for wireless systems to be developed to enable the Internet of Things, explain why public-k...
A: Introduction: It is a heterogeneous system made up of interconnected intelligent objects and sensors...
Q: If we use direct RGB value coding with 10 bits per primary colour, how many potential colours do we ...
A: Introduction: Each pixel's color options The RGB picture is in 8-bit form, which implies there are t...
Q: How much will the amount of sharing and synchronization contained in the workload employed affect th...
A: Benchmarking: When it comes to computing platforms, benchmarking is the area of research that entail...
JAVA
i will attach images of the ourQueue code and the main
I have to do the following:
*create an ourQueue object, add the following sequence:
*2,-3,4,-6,7,8,-9,-11
*create and ourStack object
*write a program/ one loop that would result into the stack containing all of the negative number at the bottom and the positive numbers at the top.
*outStack at the end should contain the following
*[-3,-6,-9,-11,2,4,7,8]
Step by step
Solved in 4 steps with 2 images
- import java.util.Scanner; public class ShoppingList { public static void main (String[] args) { Scanner scnr = new Scanner(System.in); ItemNode headNode; // Create intNode objects ItemNode currNode; ItemNode lastNode; String item; int i; // Front of nodes list headNode = new ItemNode(); lastNode = headNode; int input = scnr.nextInt(); for(i = 0; i < input; i++ ){ item = scnr.next(); currNode = new ItemNode(item); lastNode.insertAtEnd(headNode, currNode); lastNode = currNode; } // Print linked list currNode = headNode.getNext(); while (currNode != null) { currNode.printNodeData(); currNode = currNode.getNext(); } }}public class worksheet3_1 { public static void main(String[] arg) { ShadowingExample example = new ShadowingExample(); example.x = 99; example.sampleMethod(); }}class ShadowingExample { int x; public void sampleMethod() { int x = 0; System.out.println("the value of local variable x = " + ………………………………………………); System.out.println("the value of instance variable x = " + …………………………………………); }} what should be written in the second print statement so that the output is: the value of instance variable x = 99 what should be written in the first print statement so that the output is: the value of local variable x = 0 options are: samplemethod.x this.x shadowingexample.x x Answer 1 Question 1import java.util.Scanner; public class Inventory { public static void main (String[] args) { Scanner scnr = new Scanner(System.in); InventoryNode headNode; InventoryNode currNode; InventoryNode lastNode; String item; int numberOfItems; int i; // Front of nodes list headNode = new InventoryNode(); lastNode = headNode; int input = scnr.nextInt(); for(i = 0; i < input; i++ ) { item = scnr.next(); numberOfItems = scnr.nextInt(); currNode = new InventoryNode(item, numberOfItems); currNode.insertAtFront(headNode, currNode); lastNode = currNode; } // Print linked list currNode = headNode.getNext(); while (currNode != null) { currNode.printNodeData(); currNode…
- import java.util.ArrayList; public class Bus { privateStringname; privateintsize; privateintbasePrice; privateArrayList<Trip>approvedTrips; privateintlevel;// 1,2,3 for low,medium, high repectively; privateintid; privatestaticintnextId=0; privateMinistrymny; protectedStringtripTypes; privateintgetNextId(){ returnnextId++; } publicBus(){ approvedTrips=newArrayList<Trip>(); } publicBus(Stringname,intsize,intbasePrice,intlev,Ministrymny){ approvedTrips=newArrayList<Trip>(); this.name=name; this.size=size; this.basePrice=basePrice; this.level=lev; this.id=getNextId(); this.mny=mny; tripTypes="BASICTRANSPORT"; } publicbooleanavailable(Datedate){ booleanretval=true; for(Tript:approvedTrips) if(t.getDate().getDay()==date.getDay()) retval=false; returnretval; } publicintgetBasePrice(){ returnbasePrice; } publicintgetId(){ returnid; } publicStringgetName(){ returnname; } publicdoublegetSize(){ returnsize; } publicStringtoString(){ returnname; }…package priorityqueue;import java.util.Scanner; public class AdmissionsDesk{ private WaitingRoom hosp = new WaitingRoom(); public static void main(String[] args) { AdmissionsDesk desk = new AdmissionsDesk(); } public AdmissionsDesk() { queuePatients(); fillBeds(); admissionDesk(); } public void queuePatients() { Scanner reader = null; try { reader = new Scanner(new File("patients.dat")); } catch (IOException e) { System.out.println(e); System.exit(0); } while(reader.hasNextLine()) { String str = reader.nextLine(); Scanner parser = new Scanner(str); parser.useDelimiter("/"); // hosp.queuePatient(new Patient(parser.next(), parser.nextInt())); } } public void fillBeds() { // for (int i = 0; i < 10; i++) // hosp.admitPatient(); } public…class WaterSort { Character top = null; // create constants for colors static Character red= new Character('r'); static Character blue = new Character('b'); static Character yellow= new Character('g'); // Bottles declaration public static void showAll( StackAsMyArrayList bottles[]) { for (int i = 0; i<=4; i++) { System.out.println("Bottle "+ i+ ": " + bottles[i]); } } public static void main(String args[]) { //part 1 //create the bottle StackAsMyArrayList bottleONE = new StackAsMyArrayList<Character>(); System.out.println("\nbottleONE:"+ bottleONE+ " size:" + bottleONE.getStackSize()+" uniform? "+ bottleONE.checkStackUniform());…
- public class LabProgram { public static void main(String args[]) { Course cis162 = new Course(); int beforeCount; String toDrop; // Example students for testing cis162.addStudent(new Student("Henry", "Nguyen", 3.5)); cis162.addStudent(new Student("Brenda", "Stern", 2.0)); cis162.addStudent(new Student("Lynda", "Robison", 3.2)); cis162.addStudent(new Student("Sonya", "King", 3.9)); toDrop = "Stern"; beforeCount = cis162.countStudents(); cis162.dropStudent(toDrop); System.out.println("Course size: " + beforeCount + " students"); System.out.println("Course size after drop: " + cis162.countStudents() + " students"); } } import java.text.DecimalFormat; // Class representing a student public class Student { private String first; // first name private String last; // last name private double gpa; // grade point average // Student class constructor public Student(String f, String l, double g) {…public class CustomLinkedList { public static int findMax(IntNode headObj) { /* Type your code here */ } public static void main(String[] args) { IntNode headObj; IntNode currObj; IntNode lastObj; int i; int max; // Create head node headObj = new IntNode(-1); lastObj = headObj; // Add nodes to the list for (i = 0; i < 20; ++i) { currObj = new IntNode(i); lastObj.insertAfter(currObj); lastObj = currObj; } max = findMax(headObj); System.out.println(max); }}public class Runner2{ public static void main (String[] args) { StudentRecord myRecord1=new StudentRecord(); //create one object //set values myRecord1.setName("Sai"); myRecord1.setAddresss("VZM"); myRecord1.setAge(22); myRecord1.setMathGrade(97); myRecord1.setScienceGrade(85.7); myRecord1.setEnglishGrade(88); StudentRecord myRecord2=new StudentRecord(); //create another object //set values myRecord2.setName("Pavan"); myRecord2.setAddresss("VSKP"); myRecord2.setAge(20); myRecord2.setMathGrade(89.5); myRecord2.setScienceGrade(80.6); myRecord2.setEnglishGrade(78.9); }} USE ARRAYS FOR THIS
- class overload { int x; double y; void add(int a , int b) { x = a + b; } void add(double c , double d) { y = c + d; } overload() { this.x 0; %3D this.y = 0; } %3D } class Overload_methods { public static void main(String args[]) { overload obj int a = 2; double b - 3.2; obj.add(a, a); obj.add(b, b); System.out.println(obj.x + } = new overload(); + obj.y); } #3Run the codepackage ch08.apps;import ch08.maps.*; public class HMapDriver { public static void main(String[] args) { boolean result; HMap<String, String> test; test = new HMap<String, String>(10,0.75); /*String s = null;test.put(s,"value");test.put("s",null);System.out.println("Expect 'null':\t" + test.get("s"));System.out.println("Expect 'true':\t" + test.contains("s"));test = new ArrayListMap<String, String>();*/ System.out.println("Expect 'true':\t" + test.isEmpty()); System.out.println("Expect '0':\t" + test.size()); System.out.println("Expect 'null':\t" + test.put("1", "One")); System.out.println("Expect 'false':\t" + test.isEmpty()); System.out.println("Expect '1':\t" + test.size()); System.out.println("Expect 'One':\t" + test.put("1", "One")); System.out.println("Expect 'false':\t" + test.isEmpty()); System.out.println("Expect '1':\t" + test.size()); test.put("2", "Two"); test.put("3", "Three");…import java.io.*;import java.util.*; public class Client { private ArrayList<Student> students;private String dealWithType;public Client() {students = new ArrayList<Student> ();dealWithType = "coursework";dealWithType = "research";readStudent();readResult();}public void run() {for(Student s : students) {s.display();System.out.println();} } private void readResult() {for(Student s : students) {try {String data = getResultData(s.getId());if(data.equals("")) {throw new StudentNotFoundException(s.getId());}s.setData(data);}catch(StudentNotFoundException ex){System.out.println(ex);System.out.println();}}} private String getResultData(long id) {String toReturnLine = "";try {Scanner file = new Scanner(new File(dealWithType+".csv"));// read in header and throw awayfile.nextLine();while (file.hasNextLine()) {String line = file.nextLine();String[] data = line.split(",");long studentID = Long.parseLong(data[0]);if(studentID == id) {toReturnLine =…