1. Given Below Is A C++ Program Which Interactively Gets Data From Standard Input (keyboard) And Displays Output On Standard Output (screen). The Program Calculates And Print Bills For Customers Of Patrick Gas Station. Whenever A Customer Wants To Fill Up

匿名用户 最后更新于 2021-11-29 17:10 计算机类Computing

1.Given below is a C++ program which interactively gets data fromstandard input (keyboard) and displays output on standard output(screen). The program calculates and print bills for customers ofPatrick gas station. Whenever a customer wants to fill up his gastank, he will be asked for the gas amount to be filled in ringgit.He will also be asked if he needs any assistance from pumpattendant. If yes (code – 1) and his gas purchase is below 50ringgit, an additional of 50 sen will be added to the gas bill,otherwise there will be no extra charge. The customer can makepayment for his bill by cash (code -- 0) or by card (code -- 1). Ifhe opts for the second method, his printed bill will show an extra5% service charge (of total).

a Copy and paste the code into your Dexcoo editor (NOTE you can get the softcopy of the lab question from e-learning). b. Compile and run the code c. Add/modify/delete the necessary codes in order to make the program reads data from input file, instead of the keyboard, and writes output into an output file, instead of the screen Below are sample inputs and outputs for the program. Sample input Sample output (total payment) 30.00 10 50 20.00 0 0 20 100.000 1 105 80.00 11 84 8.00 1 0 8.5 Ans.

已邀请: