-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAmount.java
More file actions
33 lines (19 loc) · 738 Bytes
/
Amount.java
File metadata and controls
33 lines (19 loc) · 738 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
30
import java.util.Scanner;
public class Amount {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("Enter number of working hours : ");
int hours = input.nextInt();
System.out.print("Enter your pay per hour : ");
int pay = input.nextInt();
int totalPay = (hours * pay);
System.out.printf("Your earning is %d for %d hours", totalPay, hours);
}
}
/* The total earning of user per day
prompt the user to enter the number of working hours
create a variable that reads the users input
prompt the user to enter their pay per hour
create a variable that reads the users input
create a variable to compute the two user input
print"the total earning"