-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProduct.java
More file actions
29 lines (21 loc) · 851 Bytes
/
Copy pathProduct.java
File metadata and controls
29 lines (21 loc) · 851 Bytes
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
package basic;
import java.util.Scanner;
public class Product {
public static void main(String[] args) {
int code,qty;
String name;
float price;
double total;
Scanner sc = new Scanner(System.in);
System.out.print("Input Code :"); code=sc.nextInt();
System.out.print("Input Qty :"); qty=sc.nextInt();
System.out.print("Input Name :"); sc.nextLine(); name=sc.nextLine();
System.out.print("Input Price :"); price=sc.nextFloat();
total=price*qty;
System.out.println("Output Code :"+code);
System.out.println("Output Qty :"+qty);
System.out.println("Output Name :"+name);
System.out.println("Output Price :"+price);
System.out.println("Output Total :"+total);
}
}