Advertisement
Guest User

Untitled

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