Open nandaalfarish opened 5 years ago
int main(){ int usia, status; float uang; scanf("%d %d %f", &usia, &status, &uang); if (uang < 7.50) printf ("Insufficient fund\n"); else if (usia >= 16 && uang >= 10.50){ printf("Rate : G, PG, R\n"); printf("Schedule: Matinee, Evening\n"); }else if (usia >= 16 && uang >= 7.50){ printf("Rate : G, PG, R\n"); printf("Schedule: Matinee\n"); }else if (usia >= 13 && status == Ortu && uang >=10.50){ printf("Rate : G, PG, R\n"); printf("Schedule: Matinee, Evening\n"); }else if (usia >= 13 && status == Ortu && uang >= 7.50){ printf("Rate : G, PG, R\n"); printf("Schedule: Matinee\n"); }else if (usia >= 13 && status == Sendiri && uang >= 10.50){ printf("Rate : G, PG\n"); printf("Schedule: Matinee, Evening\n"); }else if (usia >= 13 && status == Sendiri && uang >= 7.50){ printf("Rate : G, PG\n"); printf("Schedule: Matinee\n"); }else if (usia < 13 && status == Ortu && uang >= 10.50){ printf("Rate : G, PG\n"); printf("Schedule: Matinee, Evening\n"); }else if (usia < 13 && status == Ortu && uang >= 7.50){ printf("Rate : G, PG\n"); printf("Schedule: Matinee\n"); }else if(usia < 13 && status == Sendiri && uang >= 10.50){ printf("Rate : G\n"); printf("Schedule: Matinee, Evening\n"); }else if (usia < 13 && status == Sendiri && uang >= 7.50){ printf("Rate : G\n"); printf("Schedule: Matinee\n"); } return 0; }
include
define Sendiri 0
define Ortu 1
int main(){ int usia, status; float uang; scanf("%d %d %f", &usia, &status, &uang); if (uang < 7.50) printf ("Insufficient fund\n"); else if (usia >= 16 && uang >= 10.50){ printf("Rate : G, PG, R\n"); printf("Schedule: Matinee, Evening\n"); }else if (usia >= 16 && uang >= 7.50){ printf("Rate : G, PG, R\n"); printf("Schedule: Matinee\n"); }else if (usia >= 13 && status == Ortu && uang >=10.50){ printf("Rate : G, PG, R\n"); printf("Schedule: Matinee, Evening\n"); }else if (usia >= 13 && status == Ortu && uang >= 7.50){ printf("Rate : G, PG, R\n"); printf("Schedule: Matinee\n"); }else if (usia >= 13 && status == Sendiri && uang >= 10.50){ printf("Rate : G, PG\n"); printf("Schedule: Matinee, Evening\n"); }else if (usia >= 13 && status == Sendiri && uang >= 7.50){ printf("Rate : G, PG\n"); printf("Schedule: Matinee\n"); }else if (usia < 13 && status == Ortu && uang >= 10.50){ printf("Rate : G, PG\n"); printf("Schedule: Matinee, Evening\n"); }else if (usia < 13 && status == Ortu && uang >= 7.50){ printf("Rate : G, PG\n"); printf("Schedule: Matinee\n"); }else if(usia < 13 && status == Sendiri && uang >= 10.50){ printf("Rate : G\n"); printf("Schedule: Matinee, Evening\n"); }else if (usia < 13 && status == Sendiri && uang >= 7.50){ printf("Rate : G\n"); printf("Schedule: Matinee\n"); } return 0; }