Programming

profileBizLaxin
Cmpsc1113Assignment31.doc

CMPSC1113: Computer Programming I

East Central University

Department of Mathematics and Computer Science

Assignment 3

Instructor: Dr. Khem Poudel

Please submit the answers of following question in word document with filename LastNameFirstName_Assignment1.doc and .c file(you can make single zip files of all) in Black Board by March 09, 2021

Q.N.1

Explain briefly about Algorithms, Pseudocode and Flowchart in programming. 30 Pt

2.Programming Exercise: 70 Pt

Please write a C program to solve these problem and include the output of screen shot along with separate .c file. Please include separate c file for each question. You can submit single zip file that includes all of the c file and this .doc file.

3.16 (Gas Mileage) Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankfuls of gasoline by recording miles driven and gallons used for each tankful. Develop a program that will input the miles driven and gallons used for each tankful. The program should calculate and display the miles per gallon obtained for each tankful. After processing all input information, the program should calculate and print the combined miles per gallon obtained for all tankfuls. Here is a sample input/output dialog:

image1.png

3.17 (Credit-Limit Calculator) Develop a C program that will determine whether a department store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available:

a. Account number

b. Balance at the beginning of the month

c. Total of all items charged by this customer this month

d. Total of all credits applied to this customer's account this month

e. Allowed credit limit

The program should input each fact, calculate the new balance (= beginning balance + charges – credits) , and determine whether the new balance exceeds the customer's credit limit. For those customers whose credit limit is exceeded, the program should display the customer's account number, credit limit, new balance and the message “Credit limit exceeded.” Here is a sample input/output dialog:

Enter account number (-1 to end): 100
Enter beginning balance: 5394.78
Enter total charges: 1000.00
Enter total credits: 500.00
Enter credit limit: 5500.00
Account: 100
Credit limit: 5500.00
Balance: 5894.78
Credit Limit Exceeded.
Enter account number (-1 to end): 200
Enter beginning balance: 1000.00
Enter total charges: 123.45
Enter total credits: 321.00
Enter credit limit: 1500.00
Enter account number (-1 to end): 300
Enter beginning balance: 500.00
Enter total charges: 274.73
Enter total credits: 100.00
Enter credit limit: 800.00
Enter account number (-1 to end): -1

PAGE

Page 1 of 2