-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParadiseInfo.java
More file actions
38 lines (28 loc) · 1.22 KB
/
ParadiseInfo.java
File metadata and controls
38 lines (28 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.Scanner;
public class ParadiseInfo
{
public static void main(String[] args) {
float minimumPriceForDiscount;
short discountRate;
float minimumSaving;
Scanner input= new Scanner(System.in);
System.out.print("Enter cutoff price for discount: ");
minimumPriceForDiscount= input.nextFloat();
System.out.print("Enter discount rate as a whole number: ");
discountRate= input.nextShort();
minimumSaving= computeDiscountInfo(minimumPriceForDiscount,discountRate);
System.out.println("Special this week on any service over "+ minimumPriceForDiscount);
System.out.println("Discount of "+ discountRate + " percent");
System.out.println("That's a savings of at least $"+minimumSaving);
displayInfo();
input.close();
}
public static float computeDiscountInfo(float price,short discount_rate){
return price*discount_rate/100;
}
public static void displayInfo()
{
System.out.println("Paradise Day Spa wants to pamper you.");
System.out.println("We will make you look good.");
}
}