Ok, so i was working on a code that would calauate the penalties for intoxicated driving having 3-90 days of peanlity for # of peanlites commited and the fine from $200-500. But i wanted to ask why is my code not compliing below? Any explanations on what i got wrong? Because an error wont show up...
//al = alcohol and n = warning number
void process_breathalyzer_results(double al, double n);
#include <stdio.h>
int main() {
process_breathalyzer_results(0.08, 1);
return 0;
}
void process_breathalyzer_results(double al, double n){
if (al < 0.05){
printf("PASS\n");
}else
if ((al >= 0.05) && (al < 0.08)){
if (n == 0){
printf("Invaild Input\n");
}else
if (n == 1){
printf("WARNING penalty: $200, driving suspension: 3
days\n");
}else
if (n == 2){
printf("WARNING penalty: $300, driving suspension: 7
days\n");
}else
if (n >= 3){
printf("WARNING penalty: $400, driving suspension: 30
days\n");
}else
if (al >= 0.08){
printf("FAIL penalty: $500, driving suspension:
90 days\n");
}
}
}
the PASS and WARNING works but the FAIL portion won't work....