Answer to Question #271044 in C++ for Kind

Question #271044

Write a program that accepts grade as input from the user and stores these grades in twodimensional array with dimension of 5 rows and by 5 columns. Then count the number of grades that


passed and the number of grades that failed. Grade that pass must be greater or to equal to 80.



Sample Program:


Enter the grades: 90 95 78 89 88 71 72 79 81 82 77 74 78 88 91 73 77 75 84 98 76


89 71 87 73 79



There are 12 that passed.


There are 13 that failed.

1
Expert's answer
2021-11-26T17:44:08-0500
#include <iostream>
using namespace std;
int main()
{
    int N;
    int count=1;
    cout<<"enter the size of the array: ";
    cin >> N;
    cout<<"Enter the grades: ";
    int arr[N];
    for(int i=1;i<N;i++){
    	cin>>arr[i];
    
	}
	for(int i=1;i<N;i++){
		if(arr[i]>80){
		count+=1;
		cout<<"Students that pass are: "<<count;
		cout<<"\nStudents that failed are: "<<N-count;
	}
}}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS