76 868
Assignments Done
Successfully Done
In June 2019

Answer to Question #2760 in C++ for Bahaa

Question #2760
Write a program that reads the marks of a student in the exams (mid-term,final,attendance) and print if succeeded or not.
Expert's answer
#include <iostream.h> //some times this file has title iostream,
without extension. If compilation error write #include <iostream>

#define MAX_MARK 10 //max mark
//if you will have problems write: using namespace std;

void main()
int i, n;
int m;
double am;
cout<<"Enter number of exams: "; cin>>n;
for(i=0; i<n; i++)
& do
& {
& cout<<"Mark number "<<i+1<<": "; cin>>m;
& if(m<0 || m>MAX_MARK) cout<<"Invalid value\n";
& }
& while(m<0 || m>MAX_MARK);
& am+=m;
if(am>=MAX_MARK*0.7) cout<<"Student is successful\n";
else cout<<"Student is not successful\n";
cin>>i;//delay until user not to enter some value

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions