Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import static java.lang.System.out;
- public class MainClass { //Changed 'Main Class' to 'MainClass'
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in); //Added the 'new Scanner' expression
- //Removed the delimiter entirely
- double cost = 4.20, tax = 0.07; //Removed the extra double
- out.println("Enter number of orders:");
- int orders = scan.nextInt();
- scan.close();
- out.println();
- out.print("Your total cost is: ");
- out.print(String.format("$%2.2f", orders * (cost * (tax + 1)))); //Added parenthesis around 'tax + 1' for order of operations
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement