だから私は周りを見回しましたが、どうやら正しい場所を見ていなかったか、何かを誤解しているようです。
与えられた指示は、プログラムがボールトの高さとして 2.0 から 5.0 の間の値のみを受け入れることができるということです。if 条件に関係しているように感じますが、修正方法がわかりません。
デバッグ中に高さを入力すると、else ステートメントにジャンプし、新しい入力を再入力する機会がありません。
//Retrieving name and first vault and date
cout << "Please enter the name of the pole vaulter.\n";
getline(cin, name);
cout << "Please enter the height of the first vault attempt.\n";
cin >> vault1;
if(5.0 >= vault1 >= 2.0) {
cout << "What date was this vault accomplished?\n";
getline(cin, date1);
} else {
cout << "Only jumps between 2.0 meters and 5.0 meters are valid inputs. Please enter the height of the first vault attempt.\n";
cin >> vault1;
cout << "What date was this vault accomplished?\n";
getline(cin, date1);
}