Java Programming Quiz Question?

StephanB

New member
Joined
Oct 19, 2008
Messages
4
Reaction score
0
Points
1
We sell items that cost $1.47 (double) each. Write a program that will give the following output.

1 Items = $1.47

2 Items = $2.94

3 Items = $4.41

4 Items = $5.88

5 Items = $7.35

6 Items = $8.82

7 Items = $10.29

8 Items = $11.76

9 Items = $13.23

10 Items = $14.7

HINT: System.out.println ( current+" Items = $"+current*price);
 
for(int i = 1; i <= 10; i++) {
System.out.println(i + " Items = $" + (double)(i*1.47));
}
 
Back
Top