Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions

Question

Challenges Facing Todays Organizations?

Answered: 1 week ago