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.
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();
}
}
Comments
Leave a comment