Answer to Question #210282 in C++ for Butch

Question #210282

Create a program that will create 2X3x3 dimensional array. This program will enable the user to input 3 scores of student1, student2 and student3 for every plane, then will enable to display the average score of each student in the plane.

average my vary depending on the scores inputted by the user


1
Expert's answer
2021-06-25T05:20:54-0400
#include<iostream>
using namespace std;
int main(){
	int student[2][3][3];
	cout<<"Enter the scores for the students\n";
	for(int i=0; i<2; i++){
			cout<<"The plane\t"<<i+1<<endl;
		for(int j=0; j<3; j++){
		 	cout<<"Enter three scores for student \t"<<j+1<<endl;
			for(int k=0; k<3; k++){
				
				cin>>student[i][j][k];
			}
		}
	}
	
	double average =0.0;
	
	for(int i=0; i<2; i++){
			cout<<"\nThe plane\t"<<i+1<<endl;
		for(int j=0; j<3; j++){
		 	cout<<"\nThe student\t"<<j+1<<"\tscores"<<endl;
		 	double sum =0.0;
			for(int k=0; k<3; k++){
				cout<<"\n"<<student[i][j][k]<<endl;
				sum += student[i][j][k];
				
			}
			cout<<"Total scores for student\t"<<(j+1)<<"\t"<<sum<<endl;
				cout<<"The average score for student\t"<<(j+1)<<"\t"<<sum/3<<endl;
		}
	
	}
}

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