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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started