-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExerses2.java
More file actions
30 lines (24 loc) · 1.01 KB
/
Copy pathExerses2.java
File metadata and controls
30 lines (24 loc) · 1.01 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
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
*/
package basic;
import java.util.Scanner;
public class Exerses2 {
public static void main(String[] args) {
int code,qty;
String name;
float price,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);
}
}