Logo 
Search:

C++ Programming Articles

Submit Article
Home » Articles » C++ Programming » Mathematics ProgramRSS Feeds

Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student

Posted By: Easy Tutor     Category: C++ Programming     Views: 84841

A C++ Program that reads the marks obtained of ten students out of 100 in four papers.It computes and display the total marks and status of each student.

Code for Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in C++ Programming

 #include<iostream.h>
 #include<iomanip.h>
 #include<conio.h>

 float total_marks(float []);

 main()
    {
       clrscr();

       float marks[10][4]={0};

       cout<<"\n Enter the marks of the ten students : "<<endl;

       for(int count_1=0;count_1<10;count_1++)
      {
         cout<<"\n Enter the marks obtained by student "<<count_1+1<<
                                " :"<<endl;
         cout<<"\t Subject-1 = ";
         cin>>marks[count_1][0];

         cout<<"\t Subject-2 = ";
         cin>>marks[count_1][1];

         cout<<"\t Subject-3 = ";
         cin>>marks[count_1][2];

         cout<<"\t Subject-4 = ";
         cin>>marks[count_1][3];
      }

       getch();
       clrscr();

       cout<<"\n *********************************  Result Sheet  *****************************"<<endl;
       cout<<"\n Student No.  Subject-1  Subject-2  Subject-3  Subject-4  ";
       cout<<"Total Marks  Status\n"<<endl;


       for(int count_2=0;count_2<10;count_2++)
      {
         cout<<setw(8)<<count_2+1;
         cout<<setw(13)<<marks[count_2][0];
         cout<<setw(11)<<marks[count_2][1];
         cout<<setw(11)<<marks[count_2][2];
         cout<<setw(11)<<marks[count_2][3];
         cout<<setw(11)<<total_marks(marks[count_2]);
         cout<<setw(12)<<((total_marks(marks[count_2])>=200)?"Pass":"Fail");
         cout<<endl;
      }

       cout<<"\n ******************************************************************************";

       getch();
       return 0;
    }

 /*************************************************************************///-----------------------  total_marks(float [])  -----------------------///*************************************************************************/float total_marks(float marks[])
    {
       float sum=0;

       for(int count=0;count<4;count++)
      sum+=marks[count];

       return sum;
    }
  
Share: 



Easy Tutor
Easy Tutor author of Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student is from United States. Easy Tutor says

Hello Friends,

I am Free Lance Tutor, who helped student in completing their homework.

I have 4 Years of hands on experience on helping student in completing their homework. I also guide them in doing their final year projects.

I have share many programs on this website for everyone to use freely, if you need further assistance, than please contact me on easytutor.2ya [at the rate] gmail [dot] com

I have special discount scheme for providing tutor services. I am providing tutor service to students from various contries, currently most of my students are from United States, India, Australia, Pakistan, Germany, UK and Canada.

I am also here to expand my technical network to receive more opportunity in my career, make friends to help them in resolving their technical problem, learn and share my knowledge, If you like to be my friend, Please send me friend request.

Thanks,
Happy Programming :)

 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
Neha Shelot from India Comment on: Sep 25
I WANT AN C++ ALGORITHM FOR THIS PROGRAM WHICH IS AS FOLLOWS
Given a set of n students examination marks( in the range of 0 to 100)
Write an algorithm to make a count of the number of students that obtained
each possible mark.

Sanzi Ashiq from Bangladesh Comment on: Dec 12
write a program in c not c++ that takes grades of 10 student of four course
each
student name
student id
the program then save the students information in a file..
in da followin record format
name
id
grade 1 to 4
count
cgpa
please urgent

Abhishek Banerjee from India Comment on: Aug 20
i want a c++ code that with a class stud_info.the program must accept students information(no of students,name,roll no,marks in three subjects).and then there must be a member function to calculate total marks of each studens.Finally the program should diplay the students information according to their total marks(information of student securing highest total should be displayed first and so on).




























View All Comments