Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I was wondering if anyone could help me with this C programming assignment. I have been having lot of trouble with it. I included

Hello, I was wondering if anyone could help me with this C programming assignment. I have been having lot of trouble with it. I included a brief description, details about the assignment, and specific implementation requirements. Brief Description: This program will ask the user to enter details about a class of students, one student at a time. These details include first name, last name, age, and grade. The user should be able to add up to 10 students, which will be stored in an array of structs. Details: When your program first runs, it should print out print out your name, the course number (CS102-01), and the programming assignment name (Programming Assignment #4), each on a new line. Then, the program should skip a line (i.e., print a blank line), and print a brief description of what the program does. After the description, the program should ask the user how many students they wish to enter, up to 10. If a user enters a number less than 1 or greater than 10, the program should keep asking the user the number of students until the number is between 1 and 10. Once this information is known, the program should proceed to ask for each students first name, last name, age, and grade. Once all the student information has been entered by the user, the program should output all the student information to a file called students.txt. For each student entered, this file should contain 4 lines of information. The first line should be the first name. The second line should be the last name. The third line should be the age. The fourth line should be the grade. Also, add a feature to your program which reads in an existing students.txt and allows the user to add additional students to it. Your program should, before asking the user to input the number of students, ask the user if they wish to load an existing file. If the user says yes, your program should read in the existing file, and then ask the user how many additional students they wish to add (but in any case the user should not be allowed to have more than 10 students, including existing and new). If the user declines to load the existing students.txt file, your program should proceed as normal. Specific Implementation Requirements (THESE THINGS MUST BE PRESENT OR POINTS WILL BE DEDUCTED!): 1. An array of structs should be used to store the students in memory. The structs should each contain two character arrays (for the first and last name), one integer (for the age), and one float or double (for the grade). 2. The code which writes the data to the output file should not be in main. 3. A comment block should be present before each function, explaining what the function does. 4. Comments should be present within each function, explaining any possibly confusing code. 5. The program should work correctly. This includes, among other things: 1. Your program should properly compile and run without crashing. 2. Your program should properly store names, ages, and grades without any loss of data (e.g., if I enter a grade of 9.4, but your program only stores 9, youve lost data) 6. The code that reads the data from the input file should not be in main. Thanks in advance!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions