Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. /*
  2.       Author          Sara
  3.       Department:     Key Skills
  4. */
  5.  
  6. #include   <iostream>
  7.  
  8. using namespace std;
  9.  
  10. int main () {
  11.  
  12. double mark1, mark2, mark3, total, average;
  13.  
  14. cout << "This program will compute for the total and average of three (3) marks.";
  15.  
  16. cout << " \n";
  17.  
  18. //input
  19.  
  20.     cout << " Enter mark1: \n";
  21.     cin >> mark1;
  22.  
  23.      cout << " Enter mark2: \n";
  24.      cin >> mark2;
  25.  
  26.      cout << " Enter mark3: \n";
  27.     cin >> mark3;
  28.  
  29.     // process
  30.  
  31.     total = mark1 + mark2 + mark3;
  32.     average = total /3;
  33.  
  34.     //output
  35.     cout << "\n-----------------------------------";
  36.     cout << "\n";
  37.     cout << "your total is: ";
  38.     cout << total;
  39.  
  40.     cout << "\n-----------------------------------";
  41.  
  42.     cout <<" \n";
  43.     cout << "\n-----------------------------------";
  44.     cout << " \n";
  45.     cout << "your total is: ";
  46.     cout << average;
  47.     cout <<"\n-------------------------------------";
  48.  
  49.     return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement