Java | JSP | JSF Answers

Questions answered by 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

Martin your friend has declared a class called Employee with the following members; Employee ID, Employee Name, Basic Salary, Allowance, and Net Salary. a) Write a code for a member function called get_input that will be used for data input. (3 Marks) b) Write a code for a member function called Calculate that will be used to calculate net salary as the sum of basic salary and allowances. (2 Marks) c) Write a code for the default constructor that will assign values to the variables in the Employee class. (3 Marks) d) Write a code for the default constructor. (3 Marks) e) Write a complete program that captures and includes all the details in (a-d) above. Run the code and show your output. 


Write a Java program that creates an Array of string values and displays the duplicate values.


On the form create two combo boxes, one for the country selection and another to select a town. Also, add two radio buttons for the user to select to display either a phone or postal code.


You are also required to create a menu system which will allow the user to exit the application under the file menu. Under the tools menu allow the form submission and option to display the average yearly petrol price report. The layout of the form is left to your discretion. Marks will be allocated to the presentation and effectiveness of the layout, but the following layout is displayed for your convenience.


The application must allow a user to select between two countries, namely South Africa and the United Kingdom. When a particular country is selected, present the available towns in the town combo box.



Given the number of people attending a pizza party, output the number of needed pizzas and total cost. For the calculation, assume that people eat 2 slices on average and each pizza has 12 slices and costs $14.95.

Output each floating-point value with two digits after the decimal point, which can be achieved as follows:

System.out.printf("Cost: $%.2f\n", cost);

Ex: If the input is:

4

the output is:

Pizzas: 1
Cost: $14.95

Hint: Use the ceil() method to round up the number of pizzas so that enough pizzas are ordered.


create hangman using ArrayList


Given the number of people attending a pizza party, output the number of needed pizzas and total cost. For the calculation, assume that people eat 2 slices on average and each pizza has 12 slices and costs $14.95.

Output each floating-point value with two digits after the decimal point, which can be achieved as follows:

System.out.printf("Cost: $%.2f\n", cost)


Program Specifications. Write a program to calculate the cost of hosting three pizza parties on Friday, Saturday and Sunday. Read from input the number of people attending, the average number of slices per person and the cost of one pizza. Dollar values are output with two decimals. For example, System.out.printf("Cost: $%.2f", cost);


Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.

Step 1 (2 pts). Read from input the number of people (int), average slices per person (double) and cost of one pizza (double). Calculate the number of whole pizzas needed (8 slices per pizza). There will likely be leftovers for breakfast. Hint: Use the Math.ceil() method to round up to the nearest whole number and convert to an integer. Calculate and output the cost for all pizzas. Submit for grading to confirm 1 test passes.




Program Specifications Write a program to calculate the cost for replacing carpet for a single room. Carpet is priced by square foot. Total cost includes carpet, labor and sales tax. Dollar values are output with two decimals. For example, System.out.printf("Cost: $%.2f", cost);


Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.

Step 1 (2 pts). Read from input the carpet price per square foot (double), room width (int) and room length (int). Calculate the room area in square feet. Calculate the carpet price based on square feet with an additional 20% for waste. Output square feet and carpet cost. Submit for grading to confirm 1 test passes.






A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input, output the subtotal for the pizzas, and then output the total after applying a sales tax of 6%.

Output each floating-point value with two digits after the decimal point, which can be achieved as follows:

System.out.printf("Subtotal: %.2f\n", yourValue);

Ex: If the input is:

3

the output is:

Subtotal: $29.97
Total due: $31.77

We want to calculate the total marks of each student of a class in Physics, Chemistry and Mathematics and the average marks of the class. The number of students in the class are entered by the user. Create a class named Marks with data members for roll number, name and marks. Create three other classes inheriting the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in individual subject of each student. Roll number of each student will be generated automatically.



LATEST TUTORIALS
APPROVED BY CLIENTS