-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem10.c++
More file actions
35 lines (30 loc) · 753 Bytes
/
Problem10.c++
File metadata and controls
35 lines (30 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <string>
using namespace std;
void ReadNumbers(int& Mark1, int& Mark2, int& Mark3)
{
cout << "Pleas enter your Mark 1 ? \n";
cin >> Mark1;
cout << "Pleas enter your Mark 2 ? \n";
cin >> Mark2;
cout << "Pleas enter your Mark 3 ? \n";
cin >> Mark3;
}
int SumOf3Marks(int Mark1, int Mark2, int Mark3)
{
return Mark1 + Mark2 + Mark3;
}
float CalculateAverage(int Mark1, int Mark2, int Mark3)
{
return (float)SumOf3Marks(Mark1, Mark2, Mark3) / 3;
}
void PrintResults(float Average)
{
cout << "\n The total sum of numbers is : " << Average << endl;
}
int main()
{
int Mark1, Mark2, Mark3;
ReadNumbers(Mark1, Mark2, Mark3);
PrintResults(CalculateAverage(Mark1, Mark2, Mark3));
}