-
Notifications
You must be signed in to change notification settings - Fork 1
/
ex10.cpp
28 lines (22 loc) · 832 Bytes
/
ex10.cpp
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
#include <iostream>
#include <array>
int main()
{
std::array<float, 3> times;
std::cout << "Enter the first 40m time in seconds: ";
std::cin >> times[0];
std::cout << "Enter the second 40m time in seconds: ";
std::cin >> times[1];
std::cout << "Enter the third 40m time in seconds: ";
std::cin >> times[2];
float average = (times[0] + times[1] + times[2]) / 3;
std::cout << std::endl;
std::cout << "The first time is: " << times[0] << " seconds." << std::endl;
std::cout << "The second time is: " << times[1] << " seconds." << std::endl;
std::cout << "The third time is: " << times[2] << " seconds." << std::endl;
std::cout << std::endl;
std::cout << "The average time is " << average << " seconds." << std::endl;
std::cin.get();
std::cin.get();
return 0;
}