Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . Draw the program flow chart 2 . Execute the program with sample data 3 . Show the output / * * * *

1. Draw the program flow chart
2. Execute the program with sample data
3. Show the output
/******************************************************************************
A program to find the total of a list of numbers
*******************************************************************************/
#include
using namespace std;
int main()
{
char answer;
float sum, mark, large,small, myclass[100]; //myclass is an array to store data float
cout <<"Do you have data?";
cin >> answer;
sum =0; //initialization
int j,i =0; // my counter
while ((answer=='y')||(answer=='Y'))
{
cout << "give me the mark";
cin >> mark;
i++; //increment the counter
myclass[i]=mark; //store the mark inside the array
if (i==1) large = mark; // large initialization for large
if (i==1) small = mark; // large initialization for small
if (mark>large) large=mark;
if (mark> answer;
}
j=1;
while (j<=i) cout << myclass[j++]<< endl; //print all array elements
cout << "the total for "<< i<<" numbers is "<< sum << "and the average is"<< sum/i<

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_2

Step: 3

blur-text-image_3

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

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions