0

Using C++

Questions: Along with other physical health requirements, astronaut candidates must have perfect vision (100%) and their height must be between 62 and 75 inches. Write a program that accordingly takes the vision percentage and height (in inches) as an input and prints "passed" if given conditions are satisfied and "failed" if otherwise. Sample Input 100 80 Sample Output failed Here is my code but it keeps telling me am wrong: #include <iostream> using namespace std; int main() { int vision; cin >> vision; int height; cin >> height; //your code goes here if (vision == 100 && height > 62 && height < 75) cout << "Passed"; else cout<< "failed"; return 0; }

15th Jan 2023, 10:50 PM
Al-hassan Rabi'u
Al-hassan Rabi'u - avatar
2 Réponses
+ 3
Al-hassan Rabi'u check that the capitalization of your output matches the expected capitalization. Should it be "Passed", or "passed"?
15th Jan 2023, 11:19 PM
Brian
Brian - avatar