Question
It is about the c++ integer assignment 1. Prompts the user to enter 5 integers 2. Validates each user entry to ensure that it is
It is about the c++ integer assignment
1. Prompts the user to enter 5 integers
2. Validates each user entry to ensure that it is an integer
3. Stores the user entries in a one-dimensional array of type int
4. Displays the largest and smallest integer in the array (assume all integers in the array are unique and distinct).
Requirements:
The program must consist of a class called Integers. The class must have:
A public function/method called setUserEntry. This function/method is used to:
Prompt the user for an integer
Invoke a method called validate which verifies that the entry is in fact an integer, if the entry is not an integer, the user is NOT allowed to proceed until he/she enters an integer.
A public function/method called validate ; which verifies that the entry is in fact an integer, if the entry is not an integer, the user is NOT allowed to proceed until he/she enters an integer.
The constructor uses a loop to initialize the elements in the array to zero
The displayIntegers function/method is a const public function/function which takes no parameters and uses a loop to display the values of the array.
The getLargestSmallestIntegers is a public function/method which displays the largest and the smallest integers in the array.
The array is of type int, size 5 and is a private member.
The main function must use a loop to keep the user in the program until he/she wants to quit.
You MUST submit The following THREE files:
A separate .h file called Integers.h.txt
A separate .cpp file called IntegersImp.cpp.txt
A separate .cpp file with main() called main.cpp.txt
Don't forget the corresponding pdf files!
GENERAL RESTRICTIONS FOR ALL QUIZZES, MIDTERM AND FINAL EXAM
No global variables
No labels or go-to statements
No infinite loops, examples include:
for(;;)
while(1)
while(true)
do{//code}while(1);
No break statements to exit loops
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