Answer to Question #292710 in Java | JSP | JSF for abhi

Question #292710

Bob employs a painting company that wants to use your services to help create an invoice generating system. The painters submit an invoice weekly. They charge $30 per hour worked. They also charge tax – 15%. Bob likes to see an invoice that displays all the information – number of hours, the charge per hour, the total BEFORE tax and the total AFTER tax. Since this is an invoice, we also need to display the name of the company (Painting Xperts) at the top of the invoice. Display all of the information on the screen.


1
Expert's answer
2022-02-01T05:54:24-0500


import java.util.Scanner;


public class App {


	/**
	 * The start point of the program
	 * 
	 * @param args
	 * 
	 */
	public static void main(String[] args) {
		final double chargePerHour = 30;
		final double chargeTax = 0.15;


		Scanner keyBoard = new Scanner(System.in);
		System.out.print("Enter the number of hours: ");
		int hours = keyBoard.nextInt();


		double totalBeforeTaxes = chargePerHour * hours;
		double tax = totalBeforeTaxes * chargeTax;
		double totalAfterTaxes = totalBeforeTaxes - tax;


		System.out.println("The company name is: Painting Xperts");
		System.out.println("The number of hours: " + hours);
		System.out.println("The charge per hour: " + chargePerHour);
		System.out.println("The total before taxes: " + totalBeforeTaxes);
		System.out.println("The total after taxes: " + totalAfterTaxes);
		keyBoard.close();
	}
}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS