0
What's wrong with this code
#include <iostream> using namespace std; int main() { int ages[5]; for (int i = 0; i < 5; ++i) { cin >> ages[i]; } //your code goes here int i,age; for(i=0;i<5;i++) { if(age[i]>=10 && age[i]<15) int ticket = 10; int small; int a = ages [0]; int b = ages [1]; if (a < b && a < c && a < d && a < e) small = a; else if (b < c...) etc else e = small; float disc = small * 0.01; float total = (ticket * 5) * (1.0 - disc); return total; } return 0; }
2 Answers
+ 1
tl;dr
0
I can tell that the code is loosely based on the Code Coach Ticket Office assignment.
https://www.sololearn.com/coach/904?ref=app
Beyond that resemblance ... well, if this code is your solution then I recommend resetting the code and making an actual plan for how to solve the problem. Tip: there is no need to compare specific age values. Tip2: Five lines of added code will do it.



