Year 1 Computer Science *HELP*

Question 4

Write an algorithm to help a user count their loose coin change. The program should ask the user to enter the number of £2 coins they have, then the number of £1 coins, then 50p coins, then 20p coins, then 10p coins, then 5p coins, then 2p coins and finally the number of 1p coins. Once each of these inputs has been collected the program should calculate the totalChange (a double) as pounds and pence and print this to the console.

NOTE: Inputs must come from the console so use the Console.getInt(…) method. Also, the result must be printed to the console so use the System.out.println(…) method. The prompts displayed to the user when asking for the inputs MUST exactly match those shown in the sample interaction below. Also, the result printed MUST be in the same format as the sample interaction below. A valid sample interaction would look like this:

£2: 1

£1: 1

50p: 3

20p: 1

10p: 0

5p: 2

2p: 0

1p: 2

Total change is £4.82

“Completely new to software development something i am struggling with, anyone able to assist in this matter”. It would be greatly appreciated. nathan

I will be sure to complete the curriculum

thank you so much

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.