Java | JSP | JSF Answers

Questions: 3 611

Answers by our Experts: 3 611

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 that computes the total ticket sales of a concert. There are three types of seating’s: A, B, and C and the price of a ticket for each of the three types of seats are 3000 Rs ,2000 Rs , and 1000 Rs respectively. The program accepts the number of tickets sold in each category. The total sales are computed as follows:

totalSales = numberOfA_Seats * pricePerA_Seat + numberOfB_Seats * pricePerB_Seat + numberOfC_Seats * pricePerC_Seat;


Write a java program to print all natural numbers from 1 to n - using while loop

"Hello there"/10 output

Create a public class named: Employee that would get the firstname and lastname of each

employee from the keyboard/user


Write a java code that prompts the user to input a non-negative integer and then it will reverse the same number using a while loop. For example, if the input number is 25 the output should be 52.

Sample input and output:

Example 1:

Input: 25

Output: 52

Example 2:

Input: 123

Output: 321

Example 3:

Input: 3

Output: 3


Create an OOP Java program that will ASK the user for the Prelim, Midterm, Prefinal, and Finals grades. Calculate for the FINAL GRADE (follow the calculation instructions below). Display the final grade on the console.





Calculation for Final Grade:



Get the 20% of the Prelim Grade.



Get the 20% of the Midterm Grade.



Get the 20% of the Prefinal Grade.



Get the 40% of the Finals Grade.



Add all four results. This will be the Final Grade.







1. Create two (2) classes: MyMainClass and SecondClass.




2.The class SecondClass has 5 double attributes: prelim, midterm, prefinal, finals.




3.Create one (1) constructor method to set the prelim, midterm, prefinal, and finals grades.




4.Create one (1) accessor method to calculate for and return the final grade output.




Display the final grade output in the MyMainClass.





Sample output:



Enter prelim grade:75



Enter the midterm grade: 80



Enter the prefinal grade: 90



Enter the final grade: 91



Your final grade is 85.4

In reference to your module #2,Create a simple program that will print ODD or EVEN when you enter a number.

Write a java program for Tlhogi’s Car Care Shop that shows a user a list of available services: oil change, tire rotation, battery check, or brake inspection. Allow the user to enter a string that corresponds to one of the options, and display the option and its price as R25, R22, R15, or R5, accordingly. Display an error message if the user enters an invalid item. Save the file as CarCareChoice.java.




It might not be reasonable to expect users to type long entries such as “oil change” accurately. Modify the CarCareChoice class so that as long as the user enters the first three characters of a service, the choice is considered valid. Save the file as CarCareChoice2.java.




Finally write a test class to test both classes. Save the file as TestCarCareChoice.java

The Program shall:

  • contain an arrow of 10 multiple choice questions with three (3) choices each
  • requires the user to choose among A, B, or C;

Note: Cases are ignored. Lowercase letters are acceptable (a, b, c).

Create a try-catch structure to handle three (3) exceptions. These are when the user inputs the following:

  • an invalid letter (not A, B, or C)
  • a number or any special character
  • blank (no answer)

Prompt the user that he can answer again if any of the three (3) exceptions is thrown

Display the score.


Write a program to calculate the correct packaging system for chocolates.  A user has the option to put it in a box, or put it in a box inside a container.  A box of chocolate bars can hold 30 bars and a container can hold 94 boxes of chocolates. Write a program that prompts the user to enter the total number of chocolate bars. The program then outputs the number of boxes and/or the number of containers to ship the chocolates. Note that each box must contain the specified number of chocolates each container must contain the specified number of boxes. If the last box of chocolates contains less than the number of specified chocolates you can discard it, and output the number of leftover chocolate. Similarly, if the last container contains less than the number of specified boxes, you can discard it, and output

the number of leftover boxes.


LATEST TUTORIALS
APPROVED BY CLIENTS