SlideShare a Scribd company logo
1 of 10
Download to read offline
Develop a system flowchart and then write a menu-driven C++ program that uses user-defined
functions arrays, and a random number generator.
Upon program execution, the screen will be cleared and the menu shown below will appear at
the top of the screen and centered. The menu items are explained below.
Help Smallest Largest Quit
H or h ( for Help ) option will invoke a function named help() which will display a help screen.
The help screen(s) should guide the user how to interact with the program, type of data to be
used, and what results would the program produce. Each help screen should remain on the
monitor until the user strikes any key. Once the user completes reading the help() screens,
striking any key will clear the screen and the menu is displayed again.
The main() function will declare an array of 60 elements. The elements are of type double. The
menu options S and L, will ask the user for the actual number of elements for the array. The
program must verify that the actual number of elements does not exceed 60 and is not a negative
number or 0. Your code must check for these.
S or s ( for Smallest ) option will invoke a function named smallest( ) which will prompt the user
for the number of elements for the array to be examined using the function sizeOfArray( ) which
will read and validate the desired array elements and returns it to the calling function. The
program will then use the returned size of the array to fill the array using the number generator
functions shown at the end of this assignment. Your program will ask the user for the range of
values for the elements of the array and uses these numbers in a random generator function to fill
the array. Once the array is filled, the program will call the function findSmallest( ) which will
find and return the smallest number in the array to the calling function. The program will then
call the function frequency(), that will compute and return the frequency of occurrence of the
smallest number. The program will then display the array elements, the smallest number, and its
frequency of occurrence using the function display( ), in the format shown below. The output
shown is for an array of six elements with an array identifier a.
a[0] = xxxx.xx
a[1] = xxxx.xx
a[2] = xxxx.xx
a[3] = xxxx.xx
a[4] = xxxx.xx
a[5] = xxxx.xx
Smallest no. = xxxx.xx Frequency = xx
Note that for the array elements, two digits after the decimal point is required (i.e., 365.24) and
the frequence of occurrence is of type integer.
The function prototypes to be used are as follows:
void smallest(double s[], int size);
where s is the original array declared in the main() function and size is the maximum array size
specified (60 elements in our case).
//gets the desired array size and returns it
int sizeOfArray(void);
//finds the smallest number in the array and returns it via the return statement.
double findSmallest(double s[], int myS);
//where s is the specified array name and myS is the desired size of the array.
//Finds the frequency of occurrence of the minimum number
int frequency(double s[], double smallestNo, int myS);
here, s is the desired source array, smallestNo is the smallest number found in the function
findSmallest(), myS is the desired size of the array. The frequency of occurrence of the minimum
number in the array is computed and returned via a return statement. For the smallest number use
x <= y when comparing two numbers.
The function display() prototype is:
void display(double s[], double smallestNo, int freq, int myS);
where s is the desired array name, smallestNo is the smallest number in the array, freq is the
frequency of occurrence of the smallest number, and myS is the desired size of the array. The
results should stay on the screen with the following prompt which will appear in the lower right
corner of the screen:
Strike
any key to continue...
Once the user has entered any key followed by the enter key, the screen will be cleared and the
menu is displayed again.
L or l ( for Largest ) option will invoke a function named largest( ) which will prompt the user
for the number of elements for the array to be examined using the function sizeOfArray( ) which
will read and validate the desired array elements and returns it to the calling function. The
program will then use the returned size of the array to fill the array using the number generator
functions shown at the end of this assignment. Your program will ask the user for the range of
values for the elements of the array and uses these numbers in a random generator function to fill
the array. Once the array is filled, the program will call the function findLargest( ) which will
find and return the largest number in the array to the calling function. The program will then call
the function frequency(), that will compute and return the frequency of occurrence of the largest
number. The program will then display the array elements, the largest number, and its frequency
of occurrence using the function display( ), in the format shown below. The output shown is for
an array of six elements with an array identifier a.
a[0] = xxxx.xx
a[1] = xxxx.xx
a[2] = xxxx.xx
a[3] = xxxx.xx
a[4] = xxxx.xx
a[5] = xxxx.xx
Largest no. = xxxx.xx Frequency = xx
Note that for the array elements, two digits after the decimal point is required (i.e., 365.24) and
the frequence of occurrence is of type integer.
The function prototypes to be used are as follows:
void largest(double s[], int size);
where s is the original array declared in the main() function and size is the maximum array size
specified (60 elements in our case).
//gets the desired array size and returns it
int sizeOfArray(void);
//finds the smallest number in the array and returns it via the return statement.
double findLargest(double s[], int myS);
//where s is the specified array name and myS is the desired size of the array.
//Finds the frequency of occurrence of the minimum number
int frequency(double s[], double largestNo, int myS);
here, s is the desired source array, largestNo is the largest number found in the function
findLargest(), myS is the desired size of the array. The frequency of occurrence of the maximum
number in the array is computed and returned via a return statement. For the largest number use
x >= y when comparing two numbers.
The function display() prototype is:
void display(double s[], double largestNo, int freq, int myS);
where s is the desired array name, largestNo is the largest number in the array, freq is the
frequency of occurrence of the largest number, and myS is the desired size of the array. The
results should stay on the screen with the following prompt which will appear in the lower right
corner of the screen:
Strike
any key to continue...
Once the user has entered any key followed by the enter key, the screen will be cleared and the
menu is displayed again.
Q or q (for Quit) option will clear the screen and returns the control to the Visual Studio IDE.
Note: Some of the functions can be shared between the S and L options.
Grading: Flowchart 10 points
Meaningful Documentation 10 points
Program execution without error 40 points, this includes proper use of function
prototyping, function definitions and documentation
Program logic and correct output formats 20 points, this includes at least two
sets of data for S and L options.
Notes:(please read very carefully)
1. Make sure your files are VIRUS FREE! (A grade of 0 will be given for infected files). Use
Technology lab PCs for the test.
2. Comment your program.
3. Use meaningful prompts.
4. Provide a brief description of the problem being solved.
5. Be sure to include a header file at the beginning of your program as shown in the course
syllabus.
6. NO global declarations of VARIABLES allowed in any program that you develop in this
course.
6a. The program uses many user-defined functions as stated in the assignment. You may use
additional functions to facilitate your solution. At no time you are allowed to change the essential
parts of the problem. Your function arguments cannot be more than five.
7. On the due date, submit your H7 containing the components of the program specified in the
guidelines. Create a Word file that contains the header, the flowchart, the list of your .cpp file,
and the sample runs of the program. Name this file H7NAME.docx. The source file for
H7NAME.cpp and the Visio 2013 file H7NAME.vsdx will be uploaded as well. Unrelated files
should not be present when you upload them to the Blackboard. Homework must be uploaded to
Blackboard by 9PM of the due date and late homework will not be accepted. NAME is your last
name.
8. Use Microsoft Visual Studio Enterprise 2015 compiler using default compiler settings.
9. Use Microsoft Visio 2013 to develop your flowchart.
9a. Illegal inputs must be handled properly without terminating the program.
10. Adherence to the ANSI C++ required.
11. Do not use and in this assignment and all other assignments.
12. Do not use any #define in your program until the time that is required for class declaration
header files.
13. No goto statements allowed in any program that you develop in this course.
14. Non-compliance with these notes will cost you points.
15. No collaboration on this assignment and all other assignments allowed. If you violate this
policy, your grade for the course will be F.
16. You need to show us your flowchart before we can help you with your code.
17. When copying and pasting code into a Word document, please use the Courier New font with
a font size no more than 10.
18. Late homework will not be accepted.
Solution
#include
#include
#include
using namespace std;
//Displays menu
void menu()
{
cout<<" H or h for Help";
cout<<" S or s for Smallest";
cout<<" L or l for Largest";
cout<<" Q or q for Quit";
}
//Finds the frequency
int frequency(double s[], double smallestNo, int myS)
{
int f = 0, c;
//Loops up to the size
for(c = 0; c < myS; c++)
{
//checks for the smallest number in the array
if(s[c] == smallestNo)
f++; //Updates the frequency counter
}
return f; //returns the frequency
}
//Finds the smallest number
double findSmallest(double s[], int myS)
{
//Assumes the first number is the smallest one
double small = s[0];
int c;
//Loops upto size
for(c = 1; c < myS; c++)
{
//Checks for the smallest number
if(s[c] < small)
small = s[c];
}
return small; //returns the smallest number
}
//Accepts data
void smallest(double s[], int size)
{
cout<<" Enter "<>s[c];
}
//Returns the size of array
int sizeOfArray(void)
{
int no;
cout<<" Maximum array size specified (60 elements)";
do
{
cout<<" Enter the size of the array: ";
cin>>no;
//Validates the size
if(no <= 60)
return no;
else
cout<<" Error: Maximum array size specified (60 elements)";
}while(no > 60);
}
//Displays the array elements, smallest and frequency
void displayS(double s[], double smallestNo, int freq, int myS)
{
for(int c = 0; c < myS; c++)
{
cout<<" a["<>s[c];
}
//Returns the largest number
double findLargest(double s[], int myS)
{
//Assumes the first position of the array is the largest
double larg = s[0];
int c;
//Loops up to the length of array
for(c = 1; c < myS; c++)
{
//Checks for the largest value
if(s[c] > larg)
larg = s[c];
}
return larg; //Returns the largest number
}
//Displays the help
void help()
{
cout<<" The function accepts 60 double numbers or less as per the user choice";
cout<<" Displays the numbers inputed by the user";
cout<<" User has to select the S or s to get the smallest number from the inputed numbers";
cout<<" User has to select the L or l to get the largest number from the inputed numbers";
cout<<" It also displays the frequency of the smallest and largest numbers ";
}
int main()
{
char ch;
int n;
double arr[60], sm, fr;
do
{
menu();
cout<<" Enter your choice: ";
cin>>ch;
switch(ch)
{
case 'H':
case 'h':
help();
system("pause");
break;
case 'S':
case 's':
n = sizeOfArray();
smallest(arr, n);
sm = findSmallest(arr, n);
fr = frequency(arr, sm, n);
displayS(arr, sm, fr, n);
system("pause");
break;
case 'L':
case 'l':
n = sizeOfArray();
largest(arr, n);
sm = findLargest(arr, n);
fr = frequency(arr, sm, n);
displayL(arr, sm, fr, n);
system("pause");
break;
case 'Q':
case 'q':
exit(0);
default:
cout<<" Invalid Choice: ";
}
}while(1);
}
Output:
H or h for Help
S or s for Smallest
L or l for Largest
Q or q for Quit
Enter your choice: E
Invalid Choice:
H or h for Help
S or s for Smallest
L or l for Largest
Q or q for Quit
Enter your choice: h
The function accepts 60 double numbers or less as per the user choice
Displays the numbers inputed by the user
User has to select the S or s to get the smallest number from the inputed numbers
User has to select the L or l to get the largest number from the inputed numbers
It also displays the frequency of the smallest and largest numbers
Press any key to continue . . .
H or h for Help
S or s for Smallest
L or l for Largest
Q or q for Quit
Enter your choice: s
Maximum array size specified (60 elements)
Enter the size of the array: 5
Enter 5 Numbers
23.56
20.11
89.12
20.11
78.45
a[0] = 23.56
a[1] = 20.11
a[2] = 89.12
a[3] = 20.11
a[4] = 78.45
Smallest Number = 20.11
Frequency = 2
Press any key to continue . . .
H or h for Help
S or s for Smallest
L or l for Largest
Q or q for Quit
Enter your choice: L
Maximum array size specified (60 elements)
Enter the size of the array: 4
Enter 4 Numbers
89.11
80.23
45.23
11.102
a[0] = 89.11
a[1] = 80.23
a[2] = 45.23
a[3] = 11.10
Largest Number = 89.11
Frequency = 1
Press any key to continue . . .
H or h for Help
S or s for Smallest
L or l for Largest
Q or q for Quit
Enter your choice: q

More Related Content

Similar to Develop a system flowchart and then write a menu-driven C++ program .pdf

I really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdfI really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdfpasqualealvarez467
 
Tutorial 04 (revised) (1)
Tutorial 04 (revised) (1)Tutorial 04 (revised) (1)
Tutorial 04 (revised) (1)IIUM
 
Lab7: More Arrays, Strings, Vectors, and Pointers
Lab7: More Arrays, Strings, Vectors, and PointersLab7: More Arrays, Strings, Vectors, and Pointers
Lab7: More Arrays, Strings, Vectors, and Pointersenidcruz
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxgerardkortney
 
Objectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdfObjectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdffcsondhiindia
 
Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxtiffanyd4
 
Lab11bRevf.docLab 11b Alien InvasionCS 122 • 15 Points .docx
Lab11bRevf.docLab 11b Alien InvasionCS 122 • 15 Points .docxLab11bRevf.docLab 11b Alien InvasionCS 122 • 15 Points .docx
Lab11bRevf.docLab 11b Alien InvasionCS 122 • 15 Points .docxDIPESH30
 
Practical java
Practical javaPractical java
Practical javanirmit
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4Saranya saran
 
R programming slides
R  programming slidesR  programming slides
R programming slidesPankaj Saini
 
Python_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptxPython_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptxSahajShrimal1
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013amanabr
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Kurmendra Singh
 

Similar to Develop a system flowchart and then write a menu-driven C++ program .pdf (19)

I really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdfI really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdf
 
Tutorial 04 (revised) (1)
Tutorial 04 (revised) (1)Tutorial 04 (revised) (1)
Tutorial 04 (revised) (1)
 
Lab7: More Arrays, Strings, Vectors, and Pointers
Lab7: More Arrays, Strings, Vectors, and PointersLab7: More Arrays, Strings, Vectors, and Pointers
Lab7: More Arrays, Strings, Vectors, and Pointers
 
C code examples
C code examplesC code examples
C code examples
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docx
 
Objectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdfObjectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdf
 
Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docx
 
C++ Homework Help
C++ Homework HelpC++ Homework Help
C++ Homework Help
 
Lab11bRevf.docLab 11b Alien InvasionCS 122 • 15 Points .docx
Lab11bRevf.docLab 11b Alien InvasionCS 122 • 15 Points .docxLab11bRevf.docLab 11b Alien InvasionCS 122 • 15 Points .docx
Lab11bRevf.docLab 11b Alien InvasionCS 122 • 15 Points .docx
 
Practical java
Practical javaPractical java
Practical java
 
OOP Assignment 03.pdf
OOP Assignment 03.pdfOOP Assignment 03.pdf
OOP Assignment 03.pdf
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
 
R programming slides
R  programming slidesR  programming slides
R programming slides
 
Java programlist (1)
Java programlist (1)Java programlist (1)
Java programlist (1)
 
Python_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptxPython_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptx
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
 
Maxbox starter
Maxbox starterMaxbox starter
Maxbox starter
 

More from leventhalbrad49439

Which of the following are true when comparing TCPIP to the OSI Ref.pdf
Which of the following are true when comparing TCPIP to the OSI Ref.pdfWhich of the following are true when comparing TCPIP to the OSI Ref.pdf
Which of the following are true when comparing TCPIP to the OSI Ref.pdfleventhalbrad49439
 
What is the reason for having most of the blood volume distributed w.pdf
What is the reason for having most of the blood volume distributed w.pdfWhat is the reason for having most of the blood volume distributed w.pdf
What is the reason for having most of the blood volume distributed w.pdfleventhalbrad49439
 
What is eutectic reaction What is eutectoid reaction What is perife.pdf
What is eutectic reaction What is eutectoid reaction What is perife.pdfWhat is eutectic reaction What is eutectoid reaction What is perife.pdf
What is eutectic reaction What is eutectoid reaction What is perife.pdfleventhalbrad49439
 
What are the possible types of interfund transactions What are.pdf
What are the possible types of interfund transactions What are.pdfWhat are the possible types of interfund transactions What are.pdf
What are the possible types of interfund transactions What are.pdfleventhalbrad49439
 
What are Sociocultural issues when it come to body imageSolutio.pdf
What are Sociocultural issues when it come to body imageSolutio.pdfWhat are Sociocultural issues when it come to body imageSolutio.pdf
What are Sociocultural issues when it come to body imageSolutio.pdfleventhalbrad49439
 
Water can absorb and store a large amount of heat while increasing on.pdf
Water can absorb and store a large amount of heat while increasing on.pdfWater can absorb and store a large amount of heat while increasing on.pdf
Water can absorb and store a large amount of heat while increasing on.pdfleventhalbrad49439
 
True or false1 Anabolism results in increased production of biomas.pdf
True or false1 Anabolism results in increased production of biomas.pdfTrue or false1 Anabolism results in increased production of biomas.pdf
True or false1 Anabolism results in increased production of biomas.pdfleventhalbrad49439
 
The diploid number of the hypothetical animal Geneticus introductus .pdf
The diploid number of the hypothetical animal Geneticus introductus .pdfThe diploid number of the hypothetical animal Geneticus introductus .pdf
The diploid number of the hypothetical animal Geneticus introductus .pdfleventhalbrad49439
 
The Antoine equation often is used to describe vapor pressures lnP .pdf
The Antoine equation often is used to describe vapor pressures lnP .pdfThe Antoine equation often is used to describe vapor pressures lnP .pdf
The Antoine equation often is used to describe vapor pressures lnP .pdfleventhalbrad49439
 
The converson of the English to Christianity began a rich period of .pdf
The converson of the English to Christianity began a rich period of .pdfThe converson of the English to Christianity began a rich period of .pdf
The converson of the English to Christianity began a rich period of .pdfleventhalbrad49439
 
Table 19. Highest Level of Type of organization germ layers .pdf
Table 19. Highest Level of Type of organization germ layers .pdfTable 19. Highest Level of Type of organization germ layers .pdf
Table 19. Highest Level of Type of organization germ layers .pdfleventhalbrad49439
 
Question 12 (5 points)The reason that mitosis can result in the pr.pdf
Question 12 (5 points)The reason that mitosis can result in the pr.pdfQuestion 12 (5 points)The reason that mitosis can result in the pr.pdf
Question 12 (5 points)The reason that mitosis can result in the pr.pdfleventhalbrad49439
 
peripheral circuit functions built-in to the HC12 microcontroller, t.pdf
peripheral circuit functions built-in to the HC12 microcontroller, t.pdfperipheral circuit functions built-in to the HC12 microcontroller, t.pdf
peripheral circuit functions built-in to the HC12 microcontroller, t.pdfleventhalbrad49439
 
Mendez Corporation has 10,000 shares of its $100 par value, 7 percen.pdf
Mendez Corporation has 10,000 shares of its $100 par value, 7 percen.pdfMendez Corporation has 10,000 shares of its $100 par value, 7 percen.pdf
Mendez Corporation has 10,000 shares of its $100 par value, 7 percen.pdfleventhalbrad49439
 
If the dpy-11 and unc-31 genes are linked on the same chromosome, how.pdf
If the dpy-11 and unc-31 genes are linked on the same chromosome, how.pdfIf the dpy-11 and unc-31 genes are linked on the same chromosome, how.pdf
If the dpy-11 and unc-31 genes are linked on the same chromosome, how.pdfleventhalbrad49439
 
How does a wave formation influence the resultant waveSolution.pdf
How does a wave formation influence the resultant waveSolution.pdfHow does a wave formation influence the resultant waveSolution.pdf
How does a wave formation influence the resultant waveSolution.pdfleventhalbrad49439
 
How are health services paid for Provide a definition for the term .pdf
How are health services paid for Provide a definition for the term .pdfHow are health services paid for Provide a definition for the term .pdf
How are health services paid for Provide a definition for the term .pdfleventhalbrad49439
 
Given the information regarding mitosis and meiosis, clearly and con.pdf
Given the information regarding mitosis and meiosis, clearly and con.pdfGiven the information regarding mitosis and meiosis, clearly and con.pdf
Given the information regarding mitosis and meiosis, clearly and con.pdfleventhalbrad49439
 
First, look to determine what is the earliest era that fossils have .pdf
First, look to determine what is the earliest era that fossils have .pdfFirst, look to determine what is the earliest era that fossils have .pdf
First, look to determine what is the earliest era that fossils have .pdfleventhalbrad49439
 
Figure out and write down a definition of a translation that does no.pdf
Figure out and write down a definition of a translation that does no.pdfFigure out and write down a definition of a translation that does no.pdf
Figure out and write down a definition of a translation that does no.pdfleventhalbrad49439
 

More from leventhalbrad49439 (20)

Which of the following are true when comparing TCPIP to the OSI Ref.pdf
Which of the following are true when comparing TCPIP to the OSI Ref.pdfWhich of the following are true when comparing TCPIP to the OSI Ref.pdf
Which of the following are true when comparing TCPIP to the OSI Ref.pdf
 
What is the reason for having most of the blood volume distributed w.pdf
What is the reason for having most of the blood volume distributed w.pdfWhat is the reason for having most of the blood volume distributed w.pdf
What is the reason for having most of the blood volume distributed w.pdf
 
What is eutectic reaction What is eutectoid reaction What is perife.pdf
What is eutectic reaction What is eutectoid reaction What is perife.pdfWhat is eutectic reaction What is eutectoid reaction What is perife.pdf
What is eutectic reaction What is eutectoid reaction What is perife.pdf
 
What are the possible types of interfund transactions What are.pdf
What are the possible types of interfund transactions What are.pdfWhat are the possible types of interfund transactions What are.pdf
What are the possible types of interfund transactions What are.pdf
 
What are Sociocultural issues when it come to body imageSolutio.pdf
What are Sociocultural issues when it come to body imageSolutio.pdfWhat are Sociocultural issues when it come to body imageSolutio.pdf
What are Sociocultural issues when it come to body imageSolutio.pdf
 
Water can absorb and store a large amount of heat while increasing on.pdf
Water can absorb and store a large amount of heat while increasing on.pdfWater can absorb and store a large amount of heat while increasing on.pdf
Water can absorb and store a large amount of heat while increasing on.pdf
 
True or false1 Anabolism results in increased production of biomas.pdf
True or false1 Anabolism results in increased production of biomas.pdfTrue or false1 Anabolism results in increased production of biomas.pdf
True or false1 Anabolism results in increased production of biomas.pdf
 
The diploid number of the hypothetical animal Geneticus introductus .pdf
The diploid number of the hypothetical animal Geneticus introductus .pdfThe diploid number of the hypothetical animal Geneticus introductus .pdf
The diploid number of the hypothetical animal Geneticus introductus .pdf
 
The Antoine equation often is used to describe vapor pressures lnP .pdf
The Antoine equation often is used to describe vapor pressures lnP .pdfThe Antoine equation often is used to describe vapor pressures lnP .pdf
The Antoine equation often is used to describe vapor pressures lnP .pdf
 
The converson of the English to Christianity began a rich period of .pdf
The converson of the English to Christianity began a rich period of .pdfThe converson of the English to Christianity began a rich period of .pdf
The converson of the English to Christianity began a rich period of .pdf
 
Table 19. Highest Level of Type of organization germ layers .pdf
Table 19. Highest Level of Type of organization germ layers .pdfTable 19. Highest Level of Type of organization germ layers .pdf
Table 19. Highest Level of Type of organization germ layers .pdf
 
Question 12 (5 points)The reason that mitosis can result in the pr.pdf
Question 12 (5 points)The reason that mitosis can result in the pr.pdfQuestion 12 (5 points)The reason that mitosis can result in the pr.pdf
Question 12 (5 points)The reason that mitosis can result in the pr.pdf
 
peripheral circuit functions built-in to the HC12 microcontroller, t.pdf
peripheral circuit functions built-in to the HC12 microcontroller, t.pdfperipheral circuit functions built-in to the HC12 microcontroller, t.pdf
peripheral circuit functions built-in to the HC12 microcontroller, t.pdf
 
Mendez Corporation has 10,000 shares of its $100 par value, 7 percen.pdf
Mendez Corporation has 10,000 shares of its $100 par value, 7 percen.pdfMendez Corporation has 10,000 shares of its $100 par value, 7 percen.pdf
Mendez Corporation has 10,000 shares of its $100 par value, 7 percen.pdf
 
If the dpy-11 and unc-31 genes are linked on the same chromosome, how.pdf
If the dpy-11 and unc-31 genes are linked on the same chromosome, how.pdfIf the dpy-11 and unc-31 genes are linked on the same chromosome, how.pdf
If the dpy-11 and unc-31 genes are linked on the same chromosome, how.pdf
 
How does a wave formation influence the resultant waveSolution.pdf
How does a wave formation influence the resultant waveSolution.pdfHow does a wave formation influence the resultant waveSolution.pdf
How does a wave formation influence the resultant waveSolution.pdf
 
How are health services paid for Provide a definition for the term .pdf
How are health services paid for Provide a definition for the term .pdfHow are health services paid for Provide a definition for the term .pdf
How are health services paid for Provide a definition for the term .pdf
 
Given the information regarding mitosis and meiosis, clearly and con.pdf
Given the information regarding mitosis and meiosis, clearly and con.pdfGiven the information regarding mitosis and meiosis, clearly and con.pdf
Given the information regarding mitosis and meiosis, clearly and con.pdf
 
First, look to determine what is the earliest era that fossils have .pdf
First, look to determine what is the earliest era that fossils have .pdfFirst, look to determine what is the earliest era that fossils have .pdf
First, look to determine what is the earliest era that fossils have .pdf
 
Figure out and write down a definition of a translation that does no.pdf
Figure out and write down a definition of a translation that does no.pdfFigure out and write down a definition of a translation that does no.pdf
Figure out and write down a definition of a translation that does no.pdf
 

Recently uploaded

Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

Develop a system flowchart and then write a menu-driven C++ program .pdf

  • 1. Develop a system flowchart and then write a menu-driven C++ program that uses user-defined functions arrays, and a random number generator. Upon program execution, the screen will be cleared and the menu shown below will appear at the top of the screen and centered. The menu items are explained below. Help Smallest Largest Quit H or h ( for Help ) option will invoke a function named help() which will display a help screen. The help screen(s) should guide the user how to interact with the program, type of data to be used, and what results would the program produce. Each help screen should remain on the monitor until the user strikes any key. Once the user completes reading the help() screens, striking any key will clear the screen and the menu is displayed again. The main() function will declare an array of 60 elements. The elements are of type double. The menu options S and L, will ask the user for the actual number of elements for the array. The program must verify that the actual number of elements does not exceed 60 and is not a negative number or 0. Your code must check for these. S or s ( for Smallest ) option will invoke a function named smallest( ) which will prompt the user for the number of elements for the array to be examined using the function sizeOfArray( ) which will read and validate the desired array elements and returns it to the calling function. The program will then use the returned size of the array to fill the array using the number generator functions shown at the end of this assignment. Your program will ask the user for the range of values for the elements of the array and uses these numbers in a random generator function to fill the array. Once the array is filled, the program will call the function findSmallest( ) which will find and return the smallest number in the array to the calling function. The program will then call the function frequency(), that will compute and return the frequency of occurrence of the smallest number. The program will then display the array elements, the smallest number, and its frequency of occurrence using the function display( ), in the format shown below. The output shown is for an array of six elements with an array identifier a. a[0] = xxxx.xx a[1] = xxxx.xx a[2] = xxxx.xx a[3] = xxxx.xx a[4] = xxxx.xx a[5] = xxxx.xx Smallest no. = xxxx.xx Frequency = xx Note that for the array elements, two digits after the decimal point is required (i.e., 365.24) and the frequence of occurrence is of type integer.
  • 2. The function prototypes to be used are as follows: void smallest(double s[], int size); where s is the original array declared in the main() function and size is the maximum array size specified (60 elements in our case). //gets the desired array size and returns it int sizeOfArray(void); //finds the smallest number in the array and returns it via the return statement. double findSmallest(double s[], int myS); //where s is the specified array name and myS is the desired size of the array. //Finds the frequency of occurrence of the minimum number int frequency(double s[], double smallestNo, int myS); here, s is the desired source array, smallestNo is the smallest number found in the function findSmallest(), myS is the desired size of the array. The frequency of occurrence of the minimum number in the array is computed and returned via a return statement. For the smallest number use x <= y when comparing two numbers. The function display() prototype is: void display(double s[], double smallestNo, int freq, int myS); where s is the desired array name, smallestNo is the smallest number in the array, freq is the frequency of occurrence of the smallest number, and myS is the desired size of the array. The results should stay on the screen with the following prompt which will appear in the lower right corner of the screen: Strike any key to continue... Once the user has entered any key followed by the enter key, the screen will be cleared and the menu is displayed again. L or l ( for Largest ) option will invoke a function named largest( ) which will prompt the user for the number of elements for the array to be examined using the function sizeOfArray( ) which will read and validate the desired array elements and returns it to the calling function. The program will then use the returned size of the array to fill the array using the number generator functions shown at the end of this assignment. Your program will ask the user for the range of values for the elements of the array and uses these numbers in a random generator function to fill the array. Once the array is filled, the program will call the function findLargest( ) which will find and return the largest number in the array to the calling function. The program will then call the function frequency(), that will compute and return the frequency of occurrence of the largest number. The program will then display the array elements, the largest number, and its frequency of occurrence using the function display( ), in the format shown below. The output shown is for
  • 3. an array of six elements with an array identifier a. a[0] = xxxx.xx a[1] = xxxx.xx a[2] = xxxx.xx a[3] = xxxx.xx a[4] = xxxx.xx a[5] = xxxx.xx Largest no. = xxxx.xx Frequency = xx Note that for the array elements, two digits after the decimal point is required (i.e., 365.24) and the frequence of occurrence is of type integer. The function prototypes to be used are as follows: void largest(double s[], int size); where s is the original array declared in the main() function and size is the maximum array size specified (60 elements in our case). //gets the desired array size and returns it int sizeOfArray(void); //finds the smallest number in the array and returns it via the return statement. double findLargest(double s[], int myS); //where s is the specified array name and myS is the desired size of the array. //Finds the frequency of occurrence of the minimum number int frequency(double s[], double largestNo, int myS); here, s is the desired source array, largestNo is the largest number found in the function findLargest(), myS is the desired size of the array. The frequency of occurrence of the maximum number in the array is computed and returned via a return statement. For the largest number use x >= y when comparing two numbers. The function display() prototype is: void display(double s[], double largestNo, int freq, int myS); where s is the desired array name, largestNo is the largest number in the array, freq is the frequency of occurrence of the largest number, and myS is the desired size of the array. The results should stay on the screen with the following prompt which will appear in the lower right corner of the screen: Strike any key to continue... Once the user has entered any key followed by the enter key, the screen will be cleared and the menu is displayed again. Q or q (for Quit) option will clear the screen and returns the control to the Visual Studio IDE.
  • 4. Note: Some of the functions can be shared between the S and L options. Grading: Flowchart 10 points Meaningful Documentation 10 points Program execution without error 40 points, this includes proper use of function prototyping, function definitions and documentation Program logic and correct output formats 20 points, this includes at least two sets of data for S and L options. Notes:(please read very carefully) 1. Make sure your files are VIRUS FREE! (A grade of 0 will be given for infected files). Use Technology lab PCs for the test. 2. Comment your program. 3. Use meaningful prompts. 4. Provide a brief description of the problem being solved. 5. Be sure to include a header file at the beginning of your program as shown in the course syllabus. 6. NO global declarations of VARIABLES allowed in any program that you develop in this course. 6a. The program uses many user-defined functions as stated in the assignment. You may use additional functions to facilitate your solution. At no time you are allowed to change the essential parts of the problem. Your function arguments cannot be more than five. 7. On the due date, submit your H7 containing the components of the program specified in the guidelines. Create a Word file that contains the header, the flowchart, the list of your .cpp file, and the sample runs of the program. Name this file H7NAME.docx. The source file for H7NAME.cpp and the Visio 2013 file H7NAME.vsdx will be uploaded as well. Unrelated files should not be present when you upload them to the Blackboard. Homework must be uploaded to Blackboard by 9PM of the due date and late homework will not be accepted. NAME is your last name. 8. Use Microsoft Visual Studio Enterprise 2015 compiler using default compiler settings. 9. Use Microsoft Visio 2013 to develop your flowchart. 9a. Illegal inputs must be handled properly without terminating the program. 10. Adherence to the ANSI C++ required. 11. Do not use and in this assignment and all other assignments. 12. Do not use any #define in your program until the time that is required for class declaration header files. 13. No goto statements allowed in any program that you develop in this course. 14. Non-compliance with these notes will cost you points.
  • 5. 15. No collaboration on this assignment and all other assignments allowed. If you violate this policy, your grade for the course will be F. 16. You need to show us your flowchart before we can help you with your code. 17. When copying and pasting code into a Word document, please use the Courier New font with a font size no more than 10. 18. Late homework will not be accepted. Solution #include #include #include using namespace std; //Displays menu void menu() { cout<<" H or h for Help"; cout<<" S or s for Smallest"; cout<<" L or l for Largest"; cout<<" Q or q for Quit"; } //Finds the frequency int frequency(double s[], double smallestNo, int myS) { int f = 0, c; //Loops up to the size for(c = 0; c < myS; c++) { //checks for the smallest number in the array if(s[c] == smallestNo) f++; //Updates the frequency counter } return f; //returns the frequency } //Finds the smallest number double findSmallest(double s[], int myS)
  • 6. { //Assumes the first number is the smallest one double small = s[0]; int c; //Loops upto size for(c = 1; c < myS; c++) { //Checks for the smallest number if(s[c] < small) small = s[c]; } return small; //returns the smallest number } //Accepts data void smallest(double s[], int size) { cout<<" Enter "<>s[c]; } //Returns the size of array int sizeOfArray(void) { int no; cout<<" Maximum array size specified (60 elements)"; do { cout<<" Enter the size of the array: "; cin>>no; //Validates the size if(no <= 60) return no; else cout<<" Error: Maximum array size specified (60 elements)"; }while(no > 60); } //Displays the array elements, smallest and frequency void displayS(double s[], double smallestNo, int freq, int myS)
  • 7. { for(int c = 0; c < myS; c++) { cout<<" a["<>s[c]; } //Returns the largest number double findLargest(double s[], int myS) { //Assumes the first position of the array is the largest double larg = s[0]; int c; //Loops up to the length of array for(c = 1; c < myS; c++) { //Checks for the largest value if(s[c] > larg) larg = s[c]; } return larg; //Returns the largest number } //Displays the help void help() { cout<<" The function accepts 60 double numbers or less as per the user choice"; cout<<" Displays the numbers inputed by the user"; cout<<" User has to select the S or s to get the smallest number from the inputed numbers"; cout<<" User has to select the L or l to get the largest number from the inputed numbers"; cout<<" It also displays the frequency of the smallest and largest numbers "; } int main() { char ch; int n; double arr[60], sm, fr; do {
  • 8. menu(); cout<<" Enter your choice: "; cin>>ch; switch(ch) { case 'H': case 'h': help(); system("pause"); break; case 'S': case 's': n = sizeOfArray(); smallest(arr, n); sm = findSmallest(arr, n); fr = frequency(arr, sm, n); displayS(arr, sm, fr, n); system("pause"); break; case 'L': case 'l': n = sizeOfArray(); largest(arr, n); sm = findLargest(arr, n); fr = frequency(arr, sm, n); displayL(arr, sm, fr, n); system("pause"); break; case 'Q': case 'q': exit(0); default: cout<<" Invalid Choice: "; } }while(1); }
  • 9. Output: H or h for Help S or s for Smallest L or l for Largest Q or q for Quit Enter your choice: E Invalid Choice: H or h for Help S or s for Smallest L or l for Largest Q or q for Quit Enter your choice: h The function accepts 60 double numbers or less as per the user choice Displays the numbers inputed by the user User has to select the S or s to get the smallest number from the inputed numbers User has to select the L or l to get the largest number from the inputed numbers It also displays the frequency of the smallest and largest numbers Press any key to continue . . . H or h for Help S or s for Smallest L or l for Largest Q or q for Quit Enter your choice: s Maximum array size specified (60 elements) Enter the size of the array: 5 Enter 5 Numbers 23.56 20.11 89.12 20.11 78.45 a[0] = 23.56 a[1] = 20.11 a[2] = 89.12 a[3] = 20.11 a[4] = 78.45
  • 10. Smallest Number = 20.11 Frequency = 2 Press any key to continue . . . H or h for Help S or s for Smallest L or l for Largest Q or q for Quit Enter your choice: L Maximum array size specified (60 elements) Enter the size of the array: 4 Enter 4 Numbers 89.11 80.23 45.23 11.102 a[0] = 89.11 a[1] = 80.23 a[2] = 45.23 a[3] = 11.10 Largest Number = 89.11 Frequency = 1 Press any key to continue . . . H or h for Help S or s for Smallest L or l for Largest Q or q for Quit Enter your choice: q