I'm trying to write yet another basic program for my logic class, I seem to be stuck on my if statements. I know I don't have the brackets ({, endifs) in place but thats where I am confused on where to put them, or is it a problem with my logic?
I am also supposed to throw a do while loop into the beggining as to process more than one customer.
Any help would be greatly appreciated.
Thanks
#include <stdio.h>
#define P 10.50
#define PMON 12.50
#define PPRIN 13.50
#define PMP 15.00
#define PII 15.50
#define PIIMON 18.50
#define PIIPRIN 19.00
#define PIIMP 21.00
main()
{
char comptype, rentmon, rentprint;
int rentdays;
double totamnt, rate;
printf("\nEnter type of computer rented (S=Pentium or P=PentiumII) : ");
scanf("%c", &comptype);
if (comptype == 'S' || (comptype == 's'))
printf("\nWas a monitor rented? : ");
scanf("%c", &rentmon);
if (rentmon == 'Y' || (rentmon == 'y'))
printf("\nWas a printer rented? : ");
scanf("%c", &rentprint);
if (rentprint == 'Y' || (rentprint == 'y'))
rate = PMP;
else
rate = PMON;
else
printf("\nWas a printer rented? : ");
scanf("%c", &rentprint);
if (rentprint == 'Y' || (rentprint == 'y'))
rate = PPRIN;
else
rate = P;
else
printf("\nWas a monitor rented? : ");
scanf("%c", &rentmon);
if (rentmon == 'Y' || (rentmon == 'y'))
printf("\nWas a printer rented? : ");
scanf("%c", &rentprint);
if (rentprint == 'Y' || (rentprint == 'y'))
rate = PIIMP;
else
rate = PIIMON;
else
printf("\nWas a printer rented? : ");
scanf("%c", &rentprint);
if (rentprint == 'Y' || (rentprint == 'y'))
rate = PIIPRIN;
else
rate = PII;
printf("\nEnter number of days equipment rented : ");
scanf("%d", &rentdays);
totamnt = rate * rentdays;
printf("\nTotal Amount $%.2lf\n", totamnt);
}
