Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

private void calculate() {
double tfEarth =
Double.parseDouble(tfEarth.getText());
int weight = Integer.parseInt(tfMoon.getText());
double
// TODO - get tfEarth and convert to a double and then
// set each planet text field by calculating the corresponding weight
// using the supplied constants
I think I have the right start but I can't seem to figure out what to do next
Question: Create a class that will output some famous quotes.

FamousQuotes

+ FamousQuotes()
+ quoteAristotle():void
+ quoteShakespeare ():void
+ quoteGeneKranz():void
+ quoteOscarWilde():void

The quotes that should be output for each method are:
Aristotle: Happiness depends upon ourselves
Shakespeare: 'Tis the mind that makes the body rich
Gene Kranz, (Nasa): Failure is not an option
Oscar Wilde: Experience is the name we give to our mistakes

• Create an application program that will instantiate/create an object of FamousQuotes and test all four of its methods.

• Update the program to include the following quote:
“If the facts don't fit the theory, change the facts”, Albert Einstein
6. Change owner of fruit shop
A user is asked to enter the ID of the fruit shop to change the owner of. If not found, a proper message must be indicated. Otherwise, the user enters the name and age of the new owner. Your program must reflect that change the next time the user prints the list of fruit shops.
4. Modify quantity of apples in fruit shop
Here a user is asked to enter the ID of the store to change. If not found, a proper message must be printed, otherwise your program asks for the user to enter the new quantity of apples for this store and your program must update that store’s quantity.

5. Modify price of apples in a fruit shop
Same as 4, except for the price.
3. Delete a fruit shop
A user is asked to enter an ID of the store to delete. If found, that store is erased from the record with a “Success message”. Otherwise, you must print a “not found” message.
2. Add a new fruit shop
You are required to enter information to create a new fruit shop in the system. The user must be asked to input the following:
a. Name of fruit shop
b. Current balance
c. Owner name
d. Age of owner
e. How many apples are in stock
f. The price of each apple
The ID must be auto-generated using a static variable/method. The user will not be asked for it. Try to keep the spacing as close as possible to what you see above.
// Write a method to receive 3 parameters: an array of integer number , and integer value: low, integer value: high. the method will create new array copy all values tat are between low and high into new array. the method will return the new array upon completion

// write a method to received 2 parameter. one dimensional array of integers, inter value: row
// method to create 2D whose number of rows is equal to row, it will copy all values from 1D into new array. method will return the new array upon completion
//write a method to receive two integer numbers and print the number which is nearer or equal to 20 if both number are more than 20, the method will print 0
public static void main (String [] argv)
{
nearer20 (10, 20); // Output : 20
nearer20 (18, 10); // Output : 18
nearer20 (10, 21); // Output : 10
nearer20 (30, 25); // Output : 0
}
public static void nearer20 (int n1, int n2)
{
continue

//write a method to received two integer arrays and copy the numbers in the first array repeatedly into second array
public static void main (String [] argv)
{
int []sample1 = {1, 2, 3};
int []sample2 = new int [7];
repeatCopy(sample1, sample2);
//sample2 will contain: 1 2 3 1 2 3 1
}
public static void repeatCopy (int [] data1, int[] data2)
Continue
Write an application that asks a user to type an even number to continue or to type 999 to stop. When the user types an even number, display the message “Good job!” and then ask for another input. When the user types an odd number, display an error message and then ask for another input. When the user types 999, end the program.
1- maxEvents(ArrayList<Student>): which receives array list of students and returns the name of the students who has maximum number of events.
2- sameMonth(Student s1, Student s2): which receives two objects of students and returns true if both of them have any events in the same month.
3- eventsMonth(ArrayList<Student>,int) which receives array list of students and an integer represents the month. It returns an integer represents how many students in the array list who have events at the received month.
LATEST TUTORIALS
APPROVED BY CLIENTS