Arithmetic Operations

To calculate the grade from the midterm and final exams we must divide (midterm+final) by 2. If we use midterm+final/2, it will find the midterm plus half of the final.explanation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//your name
//find average of midterm and final
#include<iostream>
using namespace std;
int main() {
  double midterm, final, average;
  cout<<"What is the midterm grade?";
  cin>>midterm;
  cout<<"What is the final grade?";
  cin>>final;
  average=(midterm+final)/2;
  cout<<"Your average is "<<average<<endl;
  system("pause");
  return 0;
}
CODE
What is the midterm grade?80
What is the final grade?90
Your average is 85
Press any key to continue . . .
grade

Remember, you should try doing each of these programs on your own. Get it to work, break it, modify it, and then try to write it on your own!

NEXT: Algebra to code