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

Write a program called CalculateSeconds.java. This program should do the following:

1. Prompt the user to enter her/his name.

2. Greet the user by name and ask to enter a number of years (assume it will be an integer).

2. Compute the number of seconds in the number of years entered by the user (this should be done by calling the numOfSeconds() method).

3. Print the resulting number of seconds as shown below.


The numOfSeconds() method will:

1.  Take an integer value as the input parameters

2.  Calculate the number of seconds in the given number of years (assume that each year has exactly 365 days, with 24 hours in each day). Note, that you would need to use long and not int for these calculations to be accurate for a large number of years!

3.  Return the number of seconds (as a long, not an int).

output

Please enter your name: 

Peter

Hello, Peter. Please enter the number of years: 

15

There are 473040000 seconds in 15 years, Peter.


Write a program called GradeBookMethod.java. This program should do the following:

1. Prompt the user to enter 3 grades (assume the grades are integer numbers)

2. Compute the average of the 3 grades by calling a method, which you write, named: average( )

3. Print the resulting average (do not worry about rounding the result, just print the value with all of the decimal places)

The average( ) method will:

1.  Take 3 integer values as the input parameters

2.  Calculate the average of the three integers (what data type should the average be?)

3.  Return the average.

Here is an example of what the program output will look like (bold-italics indicate user input):

Enter grade 1: 89

Enter grade 2: 93

Enter grade 3: 72

84.666666667 



The user must have the option to delete a product that has been saved. The user must first enter the product code to be deleted. Next, the user must confirm whether they

want to delete the product.

Q.1.10 The user must also have the ability to update specific details of the product. For

example, the user must first enter the product code and then confirm whether to

update the following product details:

Update the product warranty.

Update the product price.

Update the product stock level.

Please enter the product code to update: ASS Update the warranty? (y) Yes, (n) No n Opdate the product price? (y) Yes, (n) No y Enter the new price for EliteBook >> 14500 Update the stock level? (y) Yes, (n) No n Product details has been updated successfully!!!

Enter (1) to launch menu or any other key to exit

You have to design your own Java console application about any valid problem that your application must solve. Your solution can include solving a business problem, a new idea or even a game. Your application must make use of concepts such as arrays, loops, inheritance, constructors and information hiding. Output must be shown in the form of a report using the console.


If the user makes an incorrect product category selection, prompt the user to re-enter a valid product category.


Once the entire submission has been completed, the user must be informed that the product details have been successfully saved.


The user must have the option to delete a product that has been saved. The user must first enter the product code to be deleted. Next, the user must confirm whether they want to delete the product.


The user must have the ability to search for a product. The user will select menu item two (2), which will prompt the user to enter a product code. If a valid product is found in the application, then display the product details to the user. If no valid product is found, display an error message to the user that the product cannot be located.


Special consideration needs to be made for the selection of the product category. Allow the user to make a selection between the following categories: • Desktop Computer. • Laptop. • Tablet. • Printer. • Gaming Console. Q.1.5 If the user makes an incorrect product category selection, prompt the user to re-enter a valid product category. Q.1.6 Provide the user with the option to select between the following product warranty options: • 1 – Applies a six-month product warranty. • Any other key applies a two-year warranty. Q.1.7 Once the entire submission has been completed, the user must be informed that the product details have been successfully saved


The Airplane always needs to check with the Airport to see if it has an available runway before it's able to take off or land. Simulate the abovementioned scenario using multi-threading.


LATEST TUTORIALS
APPROVED BY CLIENTS