This task assumes that you have already been introduced to: There is some PRIMM code to guide you through the steps in the task. Try to work with a partner and discuss your code before typing and running the code. Make sure your output is correct before moving from one stage to the next, ask your teacher if you need some assistance. modulo is the integer remainder after an integer is divided by another integer, so 10 modulo 3 is 1 since 10/3 is 3 times remainder 1, in java, % is the modulo operator notice the division / and modulo % operators. use these initial test values: number is 97, modulo is 10 work with a partner an agree on what you think this code will output run the code and check the output against what you predicted (PRI section only for now) try other modulo values with 97: 9, 12, 2, 5, 3, 1, 0 predict and study the results try other combinations of your own so that you have a good understanding of how a modulo is calculated uncomment the loop MM section (remove /* and */) you may wish to comment out the PRI section code you will have seen that the loop already displays the names but not yet the line number or pounds and pence insert 2 lines of code within the loop (look for the // comment lines as a guide) first display the full amount in pence, second display the line number output from loop after modify work amend the loop code to display pounds and pence along with the name and line number Make sure all numbers display correctly the format of the list could be improved by a blank line after every 5 result lines modulo can be used to check the loop variable i decide where to insert this code and investigate what numbers should be used in the condition to produce the blank lines // replace the 0 values to System.out.println("\n"); challenge: count high costs count how many people had high costs a high cost is 2000 or more There were 11 customers with a high cost
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (