Question

c++ with pseudocodes Write a program that prompts the user to enter exam marks. The program...

c++ with pseudocodes

Write a program that prompts the user to enter exam marks. The program then displays the average mark, the highest mark and number of marks entered less than the average mark.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hey,Hey,Hey!!!

Fasten your seat-belt!!!

I like to explain and express things in such a manner so that everybody can easily understand.

So, let’s dive deep into our problem.

Here is the PseudoCode first:-

Now,Here is the Program code:-

INPUT AND OUTPUT:-

If you need the code ,here it is:-

#include<iostream>

#include <bits/stdc++.h>

using namespace std;

int main(){

    int n,count=0;

    float marks[n];

float average_marks,highest_marks,sum=0;

//Enter number of subjects

// cout<<"Enter number of subjects for which you want to enter marks: ";

cin>>n;

//Enter marks

// cout<<"Enter marks: ";

for(int i=0;i<n;i++){

    cin>>marks[i];

}

//Lets calculate average marks

for(int i=0;i<n;i++){

    sum=sum+marks[i];

}

average_marks=sum/n;

//Lets calculate highest marks

highest_marks=*max_element(marks,marks+n);

//Lets calculate number of marks entered less than the average mark

for(int i=0;i<n;i++){

   if(marks[i] < average_marks){

       count++;

   }

}

cout<<"Average marks is: "<<average_marks<<endl;

cout<<"Highest marks is: "<<highest_marks<<endl;

cout<<"Number of marks entered less than the average marks: "<<count<<endl;

return 0;

}

Please give it a thumbs up if you liked the answer.

Add a comment
Know the answer?
Add Answer to:
c++ with pseudocodes Write a program that prompts the user to enter exam marks. The program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT