Professional Documents
Culture Documents
A8 - 1620 (Description)
A8 - 1620 (Description)
Spring 2024
Assignment # 8
Total Marks: 115
Due: Thursday, March 21, 2024 @ 11:55 PM
Instructions:
1. Assignment answers/files must be submitted using the prescribed Moodle
submission link.
2. You must use the package provided in the model.
3. Don’t change the name of the .cc file.
4. Don’t change the Makefile definition/description.
5. Your assignment will be marked on program correctness and readability (including
comments).
6. Submitted work must work/run in the UofL lab environment.
7. You must submit your own work; if the work is not original or found in
collaboration, necessary steps will be taken based on UofL policy.
Write a program that uses a random number generator to generate a two-digit positive
integer and allows the user to perform one or more of the following operations:
After performing an operation if the number is less than 10, add 10 to the number. Also,
after each operation determine if the number is prime.
Each successive operation should be performed on the number generated by the last
operation. Your program should not contain any global variables and each of these
operations must be implemented by a separate function. Also, your program should be
menu driven.
PAGE # 1
Sample Input/Outputs:
37 is prime.
1: Enter 1 to double the number.
2: Enter 2 to reverse the digits of the number.
3: Enter 3 to raise the number to the power of 2, 3, or 4.
4: Enter 4 to Sum the digits of the number.
5: Enter 5 to raise the first digit to the power of the second digit.
6: Enter 6 to raise the first two digits the power of the last digit.
9: Enter 9 to terminate the program.
9
PAGE # 2
Executing the code:
Deliverables checklist
PAGE # 3