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.

26th Oct 2023, 2:27 AM
Alice
2 Antworten
+ 6
It should be age >= 4 With the bug discount is only for age 4
26th Oct 2023, 3:14 AM
Mafdi
Mafdi - avatar
+ 1
Error on 9 line :- else if(age>=4 && age <=6){ cout<<"Diacount";}
27th Oct 2023, 3:19 PM
Alhaaz
Alhaaz - avatar