Hey folks, I'm running into this weird problem that ive been trying to figure out for a week now why it isn't working.
Code:
do{ if (curbing =='Y'){
curbingCost=(CURB*length);
pavingCost=(asphalt+curbingCost);
}else if (curbing =='N'){
curbing=(CURB*length*zero);
pavingCost=asphalt;
}else {
printf("Please select Y or N\n");
}
}while(curbing !='Y' && curbing !='N');
the problem I'm getting is when I press Y everything proceeds into the next line however if i press N it goes nuts and says
"Please select Y or N" over and over again.
I asked my prof she said she knows exactly why but she wont tell me lol she said to try and figure it out, however my assignment is due tomorrow by midnight and this one problem is stopping me from completing it.
btw I did try
Code:
(curbing !='Y' || curbing !='N');
initially, however that resulted in me selecting either Y or N but nothing happens after, like:
Please select Y / N : Y
....and in that space I type whatever I want and keep hitting enter, I have to cntrl+c to exit the program.
Any help would be greatly appreciated, thank you.
p.s Im trying to avoid posting the entire code to my program as I have class members who lurk this forum and they found my Paint Program code last time and used that to submit their assignment and they including myself received a warning for plagiarism -_-.