0
Playground Tickets You are making an app to control the entrance of a playground and output the ticket category based on the age
This is my code: #include <iostream> using namespace std; int main() { int age; cin>> age; if (age >=0 && age <=3) { cout<< "Free";} else if (age == 4 && age <=6) {cout<< "Discounted"; } else {cout << "Normal";} But, the last test case is failing. 1-6 are green. I am not sure what I am missing.
2 odpowiedzi
+ 6
It should be age >= 4
With the bug discount is only for age 4
+ 1
Error on 9 line :- else if(age>=4 && age <=6){ cout<<"Diacount";}