0% found this document useful (0 votes)
57 views

C++ Programming: Assignment 6

The document describes a C++ program that: 1. Prompts the user to enter 10 student scores. 2. Calculates and displays the total score, mean, and standard deviation of the entered scores. 3. The program flowchart shows the steps to input the scores, calculate the totals, mean, and standard deviation, and output the results. 4. The C++ source code implementing the flowchart is provided.

Uploaded by

Athirah Kamil
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

C++ Programming: Assignment 6

The document describes a C++ program that: 1. Prompts the user to enter 10 student scores. 2. Calculates and displays the total score, mean, and standard deviation of the entered scores. 3. The program flowchart shows the steps to input the scores, calculate the totals, mean, and standard deviation, and output the results. 4. The C++ source code implementing the flowchart is provided.

Uploaded by

Athirah Kamil
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

C++ Programming : Assignment 6

QUESTION :

C++ Programming : Assignment 6

FLOWCHART:

START

i=0 WriteEnter the students score<<(i+1) i<SAIZ

i=0

Read x[i]

++i

i<SAIZ

WriteStudent<<i<<x*i+

Write\n<<x [10] i=0 ++i

i<SAIZ

WriteThe total score is :<<total

i=0 ++i i<SAIZ

WriteThe mean of the score :<<mean

mean=(float)total/SAIZ i=0 ++i

i<SAIZ t=x[i] - mean f=pow(t,2) sum=sum+f Std=sqrt(sum)/SAIZ WriteThe standard deviation is :<<std

END

++i

C++ Programming : Assignment 6

SOURCE CODES : #include <iostream> #include <cmath> using namespace std; int main() { const int SAIZ=10; int i, sum, x[SAIZ]; float total, average, mean, t, std, f; for (i = 0; i<SAIZ; ++i) { cout<<"\nEnter the student's score"<<(i+1)<<":"; cin>>x[i]; } for (i=0; i<SAIZ; ++i) cout<<"\nStudent["<<i<<"] = "<<x[i]; cout<<"\n"<<x[10]; for (i=0; i<SAIZ; ++i) total=total+x[i]; cout<<"\nThe total of the score is :"<<total;

C++ Programming : Assignment 6

for (i=0; i<SAIZ; ++i) { mean=(float)total/SAIZ; } cout<<"\nThe mean of the score is :"<<mean;

for (i=0; i<SAIZ; ++i) { t = x[i] - mean; f = pow(t,2); sum = sum+f; } std= sqrt(sum)/SAIZ; cout<<"\nThe standard deviation for the score is :"<<std;

cout<<"\n"; system("pause"); return 0; }

C++ Programming : Assignment 6

OUTPUT :

You might also like