-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIT1A_GROUP13_Lab3.java
More file actions
52 lines (34 loc) · 1.75 KB
/
Copy pathIT1A_GROUP13_Lab3.java
File metadata and controls
52 lines (34 loc) · 1.75 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/** This program outputs the original price of the item, the marked-up
percentage of the item, the store’s selling price of the item, the sales tax rate, the
sales tax, and the final price of the item. It displays output in columns.
* Group 13 (Replace # with your group number)
* Authors: Lobingco, Kenneth
* Islanan, Lenito Laurencio Lamberto
* Laboratory Exercise #3
* Date: March 25, 2021 (date the program was created)
*/
import java.util.Scanner;
public class IT1A_GROUP13_Lab3
{
public static void main (String [] args) {
String item;
double originalprice, markeduppercent, sellingprice, salestax, finalprice;
double m_price = 0.20;
double st_rate = 0.12;
Scanner sc = new Scanner(System.in);
System.out.print("Input item: ");
item = sc.nextLine();
System.out.print("Input price: ");
originalprice = sc.nextDouble();
markeduppercent = originalprice * m_price;
sellingprice = originalprice + markeduppercent;
salestax = sellingprice * st_rate;
finalprice = sellingprice + salestax;
System.out.print("\n");
System.out.println("-------------------------------------------------------------------------------------------------");
System.out.printf("%-15s %25s %20s %25s %25s %15s %n", "Original Price","Markup Percentage","Selling price","Sales tax rate", "Sales tax", "Final price");
System.out.println("-------------------------------------------------------------------------------------------------");
System.out.printf("%-15s %25s %20s %25s %25s %15s %n", originalprice, markeduppercent, sellingprice, "12%", salestax, finalprice );
System.out.println("-------------------------------------------------------------------------------------------------");
}
}