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
  • C++ pls use iostream Write a program that prompts the user to enter 5 exam marks...

    C++ pls use iostream Write a program that prompts the user to enter 5 exam marks (design your program such that It would be easy to change if we wanted it to work for more than 5 earns). The program python displays the average mark, the highest mark, and number of marks entered less than the average mark

  • C++ Write a program that prompts the user to enter integers or a sentinel to stop....

    C++ Write a program that prompts the user to enter integers or a sentinel to stop. The program prints the highest and lowest numbers entered, the sum and the average. DO NOT USE ARRAYS, only variables and loops. Write a program the prompts the user to input a positive integer. Keep asking the user until a positive integer is entered. Once a positive integer is entered, print a message if the integer is prime or not. (NOTE: A number is...

  • Write a program in visual c# program named CheckMonth that prompts a user to enter a...

    Write a program in visual c# program named CheckMonth that prompts a user to enter a birth month. If the value entered is greater than 12 or less than 1, display an error message; otherwise, display the valid month with a message such as 3 is a valid month.

  • (PYTHON) Write a program that prompts the user to enter the number of students and each student's score

    USE PYTHON 3Write a program that prompts the user to enter the number of students and each student's score, and displays the highest and second- highest scores.

  • In c++ please .. Write a program that prompts the user to enter a four-digit integer...

    In c++ please .. Write a program that prompts the user to enter a four-digit integer and displays the number in reverse order.

  • Write a C++ program that prompts a user to enter a temperature in Fahrenheit as a...

    Write a C++ program that prompts a user to enter a temperature in Fahrenheit as a real number. After the temperature is entered display the temperature in Celsius. Your program will then prompt the user if they want to continue. If the character n or N is entered the program will stop; otherwise, the program will continue. After your program stops accepting temperatures display the average of all the temperatures entered in both Fahrenheit and Celsius. Be sure to use...

  • c++ Write a program that prompts the user to enter a length in feet and then...

    c++ Write a program that prompts the user to enter a length in feet and then enter a length in inches and outputs the equivalent length in centimeters. If the user enters a negative number or a non-digit number, throw and handle an appropriate exception and prompt the user to enter another set of numbers. Your error message should read A non positive number is entered and allow the user to try again.

  • C++ Problem #1 Write a program that prompts user to enter an integer up to 1000...

    C++ Problem #1 Write a program that prompts user to enter an integer up to 1000 and displays back a message about the number of digits in this number and if number is odd or even. For example, if user enters 93 message back should be "93 has 2 digits and is odd".

  • In ruby Write a program that prompts the user to enter a year and first day...

    In ruby Write a program that prompts the user to enter a year and first day of the year, and displays the calendar table of that year. For example, if the user entered the year 2019, and 2 for Tuesday, January 1, 2019, your program should display the calendar for each month in the year 2019.

  • I need to Write a test program that prompts the user to enter 10 double values...

    I need to Write a test program that prompts the user to enter 10 double values into an array, calls a method to calculate the average of the numbers, and displays the average. Next, write a method that returns the lowest value in the array and display the lowest number. The program should then prompt the user to enter 10 integer values into an array, calculates the average, and displays the average. The program should have two overloaded methods to...

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