Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author Sara
- Department: Key Skills
- */
- #include <iostream>
- using namespace std;
- int main () {
- double mark1, mark2, mark3, total, average;
- cout << "This program will compute for the total and average of three (3) marks.";
- cout << " \n";
- //input
- cout << " Enter mark1: \n";
- cin >> mark1;
- cout << " Enter mark2: \n";
- cin >> mark2;
- cout << " Enter mark3: \n";
- cin >> mark3;
- // process
- total = mark1 + mark2 + mark3;
- average = total /3;
- //output
- cout << "\n-----------------------------------";
- cout << "\n";
- cout << "your total is: ";
- cout << total;
- cout << "\n-----------------------------------";
- cout <<" \n";
- cout << "\n-----------------------------------";
- cout << " \n";
- cout << "your total is: ";
- cout << average;
- cout <<"\n-------------------------------------";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement