Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If you can help me out with this please, the language needs to be in c++. thank you. 3. Write a program that requests an

If you can help me out with this please, the language needs to be in c++. thank you.

3. Write a program that requests an integer and displays:

- all factors of the input (numbers that evenly divide the input) (i.e. 1,2,3,5,6,10,15 are all factors of 30)

- if the input is prime (input that is only divisible by 1 and itself).

a) Request an integer value between 1 and 100.

b) Validate input value type and range via a do while loop.

c) Display all factors of the value.

d) Indicate if the number is prime. Output Example 1: Enter an integer between 1 and 100: 5.3

Invalid value. Please try again.

Enter an integer between 1 and 100: 103

Invalid value. Please try again.

Enter an integer between 1 and 100: 56 Factors of 56: 1 2 4 7 8 14 28 56 Output Example 2: Enter an integer between 1 and 100: 0 Invalid value. Please try again. Enter an integer between 1 and 100: 5 Factors of 5: 1 5 5 is a prime number.

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

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago