A teacher has stored the percentage scores for eighty-six (86) students; she has the following tasks to complete: • compute and print the average score. • add an additional fourteen percent to each student’s score Write a pseudo-code that will first allow the teacher to enter the initial percentage score for each student, as well as add the 14% to each student’s score. Your solution must then compute and display the average score. Your solution must implement and use an array to store and process the percentage scores
#include <iostream>
using namespace std;
int main()
{
int n=86;
int marks[n];
cout<<"Enter the marks of the 86 students: \n";
for(int i=0;i<n;i++){
cin>>marks[i];
}
//• compute and print the average score.
int sum=0;
for(int i=0;i<n;i++){
sum+=marks[i];
}
cout<<"\nAverage score is: "<<sum/n<<endl;
//add an additional fourteen percent to each student’s score
for(int i=0;i<n;i++){
marks[i]=marks[i]+14;
}
cout<<"Student scores after 14 percent increase: \n";
for(int i=0;i<n;i++){
cout<<marks[i]<<"\t";
}
return 0;
}
Comments
Leave a comment