-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathMain.java
More file actions
23 lines (18 loc) · 973 Bytes
/
Main.java
File metadata and controls
23 lines (18 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package org.codedifferently;
import java.util.*; //Imports a variety of classes
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in); //Scanner object named "input"
//This chunk of code prompts the user to enter their information
System.out.print("Enter your name ");
String customerName = input.nextLine();
System.out.print("Enter your budget (numbers only) ");
String customerBudget = input.nextLine();
System.out.print("Enter a coupon code ");
String couponCode = input.nextLine().toUpperCase();
System.out.println();
Receipt customerReceipt = new Receipt(); //Creates a new receipt object used to call the receipt methods
customerReceipt.displayReceipt(customerName,Double.parseDouble(customerBudget),couponCode); //calls the displayReceipt method to display all the receipt information
input.close();
}
}