Question: Write a C++ program that does the following : Define a class myInt that has as its single attribute an integer variable and that contains

Write a C++ program that does the following :

Define a class myInt that has as its single attribute an integer variable and that contains member functions for determining the following information for an object of type myInt:

A. Is it multiple of 7 , 11 , or 13.

B. Is the sum of its digits odd or even.

C. What is the square root value.

D.Is it a prime number.

E. Is it a perfect number ( The sum of the factors of a perfect number is equal to the number itself for example : 1 + 2 + 4 + 7 + 14 = 28 , so 28 is a perfect number ).

F. All of the above.

Z. Exit Write a interface that tests your functions

NOTES:

Just one .cpp ( Header file , implementation of header file and the interface all in one program)

Must define a class with at least 6 functions. Do not use arrays etc.

Validation on the menu selection.

Validation on the integer value that is entered by the user.

Free output format.

Test your functions by entering values such as 104 , 3773 , 13 , 121 , 77 , 3075

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!