Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your HW1 program starts by printing out to the screen a quick description of what an Highly Composite Number(HCN) is. The program continues by asking

Your HW1 program starts by printing out to the screen a quick description of what an Highly Composite Number(HCN) is. The program continues by asking the interactive user for an integer from 1 to 10,000,000, inclusive. I will call that number X. The prompt should be explicit about what X should be.

If the user enters something that is not an integer, then your program should give an appropriate error message and reprompt for X. If the user enters something that is an integer, but is outside the specified range, then the program should give a different, appropriate error message and reprompt for X. This should continue until the user enters an X that is legal according to the specification above.

When a legal X has been entered by the interactive user, your program should print out the HCN that is closest to X, with an explanation. Perhaps there could be a tie between two HCNs where HCN1 < HCN2, and (X HCN1) = (HCN2 X); if that is the case, the program should print out both HCN1 and HCN2, with an appropriate explanation. If X is itself an HCN, then X is the closest to X, and your program should print out an appropriate explanation.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago