Literature Notes
Test Prep
Study Guides
Home
Questions and Answers Archive
Java Programming
Java Programming Questions and Answers
When I run my code, there are some errors, I want to know how to fix it. This is my code, Transit.java package transit; import java.util.ArrayList; /** * This class contains methods which perf...
Please update the method, which is highlighted by following this rule. this is in JAVA. Just want the addScooter method. 6. addScooter Your city has FINALLY added those new electric scooters (you ma...
I want to know how to write the these code in Visual Studio Transit.java Driver.java TNode.java Input.txt and Scoooter.txt . package transit; Import java.util.ArrayList; * This class cont...
This method builds your layered linked list structure. It takes in sorted integer arrays representing train stations, bus stops, and walking locations. It is guaranteed that the bus array contains all...
Using the Java snippet below, what object-oriented principle (s) are being applied here? inheritance + polymorphism (method overriding) public interface Y { O encapsulation only public void start( ); ...
Match all the parts of this method signature in Java: O protected = class scope declaration static = access modifier protected static String findName(long id) {} String = method parameter id = return ...
Using the Java snippet below, where can z be accessed from? only A public class Test { O A, B, and D int x; O only C public Test( ) { 1/ A O A, B, C, and D public int dostuff( ) { Clear Next int y; 1/...
Predict the output of this Java code snippet O 2 int [ ] nums = {2, 9, 1, 5, 8, 3, 2} ; int x = 0; 0 4 for (int i = 0; i < nums . length; i++) { 0 5 if ( nums [i] != 8) { continue; O 3 } else if (n...
Predict the output of this Java code snippet O 2 int [ ] nums = {1, 2, 3, 4, 5, 6} ; 0 3 int sum = 0; int x = 0; 0 6 while (x < 3) { sum += nums [x]; O 21 x+ +; Clear Next System . out . printIn (s...
Why does this Java code not print "hello world"? The String constructor is not used String h = "hello"; The print statement is not correct h . concat (" world"); String d...
In the Java code below, how could you change it to make it print "bar" instead? Change the order of the names in the array String[ ] names = {"Andrew", "Bob"} Add another...
Predict the output of this Java code snippet It prints "bar" because the first name is "Andrew" String[ ] names = {"Andrew", "Bob" } O It prints "foo"...
Please do this (Java Programming) A car sales company requires a server to store all its car data and share it between its sales personnel. For the purposes of this assignment each car has the ...
"There should be a program in Java to sort and search hotel booking information. The public interface of BookingManager is described below, along with a ready-to-use class BookingInfo. The following r...
How to create an array list in java for the below data and an output i.e. println. please share output /test logs Data for array list is listed below; Jasper riley , 200 Jamaica street will la...
How to implement the below class in java using an array list ? public classSociety { private Stringname; public Society(StringsocietyName) { this.name = societyName; } public void add Mem...
Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards, then backwards. End each loop with a newline. Ex: If courseGrades = {7...
Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print a space after each seat, including after the last. Use separate print s...
Print numbers 0, 1, 2, ..., userNum as shown, with each number indented by that number of spaces. For each printed line, print the leading spaces, then the number, and then a newline. Hint: Use i and ...
Write a method called isOddDigits whish take two number and return true if both numbers have odd number of digits isOddDigits(123, 4213) should return false. Because 123 contains 3 digits (odd numb...
This is a UML Diagram which showing a part of a program to manage membership at a society Below is a Java version of the class diagrams above How to test the application by creating a new mem...
write method called drawcross that take an integer parameter for the size of pattern .the method should print a "cross" patreen with #characte. the size of pattren is always an ood number at least...
Write a method called drawCross that takes an integer parameter for the size of a pattern. The method should print a "cross" pattern with '#' character as shown in the examples below, assuming that th...
You will, using object-oriented principles, design a set of interrelated classes and implement them as a Java program. It's your final grand challenge! Specifically, you will create and document a pro...
Part I: AFLTeamMember (10 marks) You will implement a class AFLTeamMember. Each team member (players, coaches, etc.) has a name and a position. The positions on an AFL team are as follows: FB, HB, C, ...
In particular, make sure that all classes and method names are spelled and capitalized exactly as described in this document. Throughout this question you are allowed to use everything we have lear...
Throughout this assignment you are allowed to use everything we have learned in class up to and including loops (while and for). This does not mean however that you are allowed to change any of the he...
.ca/eclass/mod/quiz/attempt.php?attempt=361413&cmid=320264&page=1 EC3030 A - Systems Architecture (F Consider this instantiation code: Room r = new Room( ) ; Lamp p = new Lamp ( ) ; ut of r. s...
C3030 A - Systems Architecture (Fa Consider this instantiation code: Room r = new Room( ) ; FloorLamp p = new Lamp(); r. setLamp(p); r. turnLightOn ( ); tion r. turnLightoff( ); Will it compile, and i...
Please explain all the methods used and explain why they were used? import java.util.Scanner; public class MaxAndFibonacci { public static int maximum(int[] numbers, int n) { if (n == 1) { re...
How to write a program in Java to find the solution for the following problems using Recursion. Input n values into an array a[] using the scanner class. Find the maximum of an array. If n= 1, a[0] is...
Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, and output all i...
Your need to research the topic data security and identify the core elements of data security . Your need to include the following in your response... List and describe three core elements of data ...
Can someone please help me with this? The original code must be used. It cannot be changed. They just want 3 statements to print the first 3 elements of array runTimes. 4.2.2: Printing array elements...
Consider the following code: public void setFurnace(OnOffAble frn){ furnace = frn; } Please briefly describe, how the Liskov's substitution principle allows you to use a type other tha...
(Please use JAVA. all code for the zip file tme3Start.zip will be at the bottom, i will also provide screenshot of the 4 examples) Step 1: Preparation and familiarization 1. Find a working directory f...
6.22 LAB: Output values below an amount - methods Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, ...
file named A10.java. Place all your code in this file. Create public static ArrayList of integers named intList. Define public static method addNumber (int i) that adds i to your list. Create public s...
file named A7.java. Place all your code in this file. define class named Point. It should have private field integers x and y. The constructor should take x and y as parameters and assign the input va...
file named A6.java. Place all your code in this file. a class definition for Date, an object type that contains three private field integers: year, month, and day. This class should provide two constr...
file named A3.java. Place all your code in this file. method with the following header: public static boolean endOther(String a, String b) Define it as follows: Given two strings, return true if eithe...
file named A2.java. Place all your code in this file. method with the following header: public static boolean answerCell(boolean isMorning, boolean is Mom, boolean isAsleep) Define it as follows: Your...
QUESTION: Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, which ...
PLEASE HELP ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! A program which finds an approximate solution to an equation f(x) = 0 for some function f. Use the bisection method. To solve the probl...
Write application that allows a user to enter any number of student quiz scores until the user enters 99. If the score entered is less than 0 or more than 10, display an appropriate message and do not...