Question: give a basic C programming code ( NOT IN C++) ....... simple c programming only Step 1-get the input from the txt file (the text
give a basic C programming code (NOT IN C++) ....... simple c programming only
Step 1-get the input from the txt file (the text file should contain the first name and the number between 5-95 (any number that is multiple of 5))
Example:-
roman
60
Sona
70
Step 2: prompt a user for menu to chose number 1 or number 2
Example:
1.Please enter the name
2.Please press 2 to output csv file and exit the program.
Step 3:-when user press 1
i.Ask user to input the name
ii.If the name is found in the data file then print the name and the cents and give the change that is required to be given to that person for example:(if the user enters Sona the output must be customer
Sona70 cents
50 cents = 1, 20 cents = 1, 10 cents = 0 , 5 cents =0
iii.ELSE if the name is not there then
iv.Print "Name not found"
Step 4: when the user press 2
i.Theprogram will write the coin and change data in CSV format to file called change.csv. once file is written exit the program. In change.csv, the data line for sona will appear like the following,
with each value separated by a comma and the line is terminated by newline:
sona,70,1,1,0,0
Each data line in change.csv will be in the format:
name of person,total coin value,number of 50 cent coins, number of 20 cent coins,number of 10 cent coins,number of 5 cent coins newline.
sample output Sona has 70 cents in one 50 cent coin and one 20 cent coin. There are no 10 or 5 cent coins.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
