(Solved) : Exercise 1 Ascending Power Numbers Department History Bought New Photocopier Person Using Q30000960 . . .
write it in C++ pleaseExercise #1: Ascending Power Numbers The department of History has just bought a new photocopier. Any person using the photocopier must enter his/her type and an identification code. You have been asked to do the following: Write a program that determines whether identification codes typed by users of a photocopier are valid, and prints appropriate messages. If the identification code, which is a four-digit number, is correct your program computes the cost of copying according to the table below Your program should prompt the user for type, an identification code, and number of pages, read the information, and determine whether the code is valid or not. An identification code is valid if its rightmost digit is correct. A correct digit is equal to the remainder of the sum of the other three digits divided by 7, For example, a valid code that gives a correct digit is 7011 because (7+0+1) % 7 1 However, 9998 is not a valid code because (9+9+9) 96 7 6 8. Write a program that reads the person’s type (S, s, T, t, C,c,O, or o), person’s code, and the number of pages. The program checks if the code is correct it calculates and prints the cost, while if the code is not correct it prints the message “Invalid code” and stops Correct digits are assigned as follows: Number of pages 1 to 10 Student (S): 1,2 (means 1 or 2) Teacher (T): 3,4, 5 Secretary (C): 6 Others (O): 7, 8,9 11 to 20 | 20% off | 30% off | 25% off | 10% off 20 40% off 40% off 40% off 20% off Students Teachers Secretaries Others 0.10 Dhs 0.30 Dhs 0.20 Dhs 0.60 Dhs Sample input/output: nter the type, code, and number of pages:s 7590 21 Invalid codel nter the type, code, he cost is: 1.26 pages: s 7691 21 nter the type, code, and number of pages: C 3551 17 Invalid code! Enter the type, code, and number of pages: C 3556 17 The cost is: 2.55 Show transcribed image text
Expert Answer
Answer to Exercise 1 Ascending Power Numbers Department History Bought New Photocopier Person Using Q30000960 . . .
OR