// Personal Best
#include <iostream>
#include <string>
using namespace std;
int main() {
string name;
string dateFirst, dateSecond, dateThird;
double firstVault, secondVault, thirdVault;
// Get user input for name and date.
cout << "Enter the athlete name\n";
cin >> name;
cout << "Enter the first date of the ahtlete's vault\n";
cin >> dateFirst;
cout << "Enter the athlete's best vaults height on this date\n";
cin >> firstVault;
// Validate user input
if (firstVault >= 2 && firstVault <=5 )
{
cout << "Enter the second date of the ahtlete's vault\n";
cin >> dateSecond ;
cout << "Enter the athlete's best vaults heights on this date\n";
cin >> secondVault;
if (secondVault >= 2 && secondVault <=5)
{
cout << "Enter the third date\n";
cin >> dateThird ;
cout << "Enter the athlete's best vaults on this date\n";
cin >> thirdVault;
if (thirdVault <= 2 && thirdVault >=5)
{
cout << "Only enter values from 2-5 metres\n";
}
}
else
{
cout << "Only enter height vaultes in the range of\n";
cout << "2 metres to 5 metres\n";
}
}
else
cout << "Only enter height vaultes in the range of 2 metres to 5 metres\n";
// Display the output
cout << "List of best vaults made by " << name << endl;
cout << "__________________________________________\n";
// Making decisions of the list of best vaults
if ((firstVault > secondVault) && ( firstVault > thirdVault))
{
cout << "The best vault made was " << firstVault << endl;
cout << "And it was made on " << dateFirst << endl;
if (secondVault > thirdVault)
{
cout << "The second best vault made was " << secondVault << endl;
cout << "And it was made on " << dateSecond << endl;
cout << "The third best vault made was " << thirdVault << endl;
cout << "And it was made on " << dateThird << endl;
}
else
{
cout << "The second best vault made was " << thirdVault << endl;
cout << "And it was made on " << dateThird << endl;
cout << "The third best vault made was " << secondVault << endl;
cout << "And it was made on " << dateSecond << endl;
}
}
else if ((secondVault > firstVault) && (secondVault > thirdVault))
{
cout << "The best vault made was " << secondVault << endl;
cout << "And it was made on " << dateSecond << endl;
if (firstVault > thirdVault)
{
cout << "The second best vault made was " << firstVault << endl;
cout << "And it was made on " << dateFirst << endl;
cout << "The third best vault made was " << thirdVault << endl;
cout << "And it was made on " << dateThird << endl;
}
else
{
cout << "The second best vault made was " << thirdVault << endl;
cout << "And it was made on " << dateThird << endl;
cout << "The third best vault made was " << firstVault << endl;
cout << "And it was made on " << dateFirst << endl;
}
}
else
{
cout << "The best vault made was " << thirdVault << endl;
cout << "And it was made on " << dateThird << endl;
if (firstVault > secondVault)
{
cout << "The second best vault made was " << firstVault << endl;
cout << "And it was made on " << dateFirst << endl;
cout << "The third best vault made was " << secondVault << endl;
cout << "And it was made on " << dateSecond << endl;
}
else
{
cout << "The second best vault made was " << secondVault << endl;
cout << "And it was made on " << dateSecond << endl;
cout << "The third best vault made was " << firstVault << endl;
cout << "And it was made on " << dateFirst << endl;
}
}
return 0;
}