i want the user to enter 3 dates and 3 pole jumps and give the jumps and dates in the order of best to least but i"m having errors and logic mistakes can some one help me, i // the first part to focus on the beginning then i was going t get the rest.
#include<iostream>
#include<iomanip>
using namespace std;
int main ()
{
double date1,date2,date3,hight1,hight2,hight3;
const int name = 11;
char word[name];
cout <<"please enter your first name:"<<endl;
cin >>setw(name) >> word;
cout <<"please enter the dates you jumped example (2008)"<<endl;
cout <<"date one: "<<endl;
cin >>date1;
cout <<"date two: "<<endl;
cin >>date2;
cout <<"date three: "<<endl;
cin >>date3;
cout <<"now the hight example (2.0)"<<endl;
cout <<"your best jump was " <<date1 <<" "<<hight1<<endl;
if(hight1 > hight2 && hight1 > hight3)
{
cout <<"your second jump was "<<date2 <<" "<<hight2<<endl;
cout <<"your third jump was " <<date3 <<" "<<hight3<<endl;
}
else if (hight1 > hight2 && hight1 > hight3)
{
cout <<"your second jump was "<<date3 <<" "<<hight3<<endl;
cout <<"your third jump was " <<date2 <<" "<<hight2<<endl;
}
}
// else if (hight2 > hight1 && hight2 > hight3)
// {
// cout <<"your best jump was " <<date2 <<" "<<hight2<<endl;
// cout <<"your second jump was "<<date1 <<" "<<hight1<<endl;
/// cout <<"your third jump was " <<date3 <<" "<<hight3<<endl;
// }
// else if(hight3 > hight2 && hight3 > hight1)
// {
// cout <<"your best jump was " <<date3 <<" "<<hight3<<endl;
// cout <<"your second jump was "<<date2 <<" "<<hight2<<endl;
// cout <<"your third jump was " <<date1 <<" "<<hight1<<endl;
// }
// else if(hight3 > hight1 && hight3 > hight2)
// {
// cout <<"your best jump was " <<date3 <<" "<<hight3<<endl;
// cout <<"your second jump was "<<date1 <<" "<<hight1<<endl;
// cout <<"your third jump was " <<date2 <<" "<<hight2<<endl;
After if (hight1 > hight2 && hight1 > hight3) You open one uneccecary bracket '{' and you include the rest of your code in this if...
You should close the if after cout <<"your best jump was " <<date1 <<" "<<hight1<<endl;