The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
6) Write a C program to create a file by reading the name of a file from the command line.
The purpose of the file is to store student records, with the following fields:
Name, Roll number, Branch, Marks of 5 subjects.
Your program should allow the user to perform the following operations.
1) Append student record into the file
2) Display all the records in the file (Output should be as per the format given in
sample input & output, case 3)
3) Count the number of records in the file
4) Calculate and print average total-marks in the console
Note: File-handling, is the name of the program written for the above mentioned task,
STUDENT.dat is the name of the file that your program should create.
File-handling STUDENT.dat
Menu:
a) Append record
b) Display all the records
c) Count the records and calculate the average total-marks
d) Exit
Enter your choice: a
Enter Name, Roll number, Branch, Marks of 5 subjects:
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll