Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ PROGRAMMING LANGUAGE C++ PROGRAMMING LANGUAGE Learning Objectives Understand how to create and compile an executable using Makefile Review arrays Introduction to basic database operations

C++ PROGRAMMING LANGUAGE

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed C++ PROGRAMMING LANGUAGE

Learning Objectives Understand how to create and compile an executable using Makefile Review arrays Introduction to basic database operations Mrs. Niedermeyer is the new physics teacher at East Cornchester High School. She needs a program to help keep records of each of her student's grades. The program needs to do the following: Import student records from the roster file when the program opens Allow the user to search the records to see the grades that a particular student has Allow the user to create a new student record Allow the user to delete a student record I Get a count of the students enrolled in her class . Go through all student records and display a brief record for each stu- dent (both in lexicographical order and in order by grade) When the program exits via option 7, update the roster file so that Mrs. Niedermeyer may pick up where she left off at a later time. Files you have access to Your beloved instructor has lovingly provided you with several files to get you started. The following files are available from the instructor's directory: testRoster.txt: A test file with test data with which you may test your program main.cpp: The c++ file which contains the main program. Ordered List.h: A header file for the Ordered List class Student.h: The header file for the Student class Student.cpp: A set of functions for the Student class. You may download each of the files above with the following command: cp /classes/cs1254/cs1254.laf/progl/". Please note the dot at the end of the command above. That is not a typo, that's part of the command. Also, you should be in the proper directory when you run the download command What you will be responsible for You will create the following files: Ordered List.cpp: A set of functions for the Ordered List class. I Makefile: The file which contains the recipe for creating a out, the executable file that will run the program. Further details about the program The program is menu driven. The program reads a roster file the name of which the user types into the command line. After compiling the program, the program is run by using the following command: a.out (name of roster file) The roster file will start with 4 lines. The first 3 lines will contain real numbers, and the 4th line contains an integer. The first 3 lines each contain a number greater than 0.0 and less than 1.0, and all add up to 1.0. They are the weights of the homework, quizzes, and the final exam respectively. The 4th line shows the number of students in the roster. Each line thereafter contains the data for each student. Each student line contains the student's last name, then a tab, then the first name, then a tab, then 9 integers, each separated by a tab. The first 4 integers in the student line are the grades for each of 4 homework assignment where each grade is out of 100. The following 4 integers in the student line are grades for each of 4 quizzes, where each grade is out of 100. The final integer is the grade for the final exam, which is out of 100. Additional Coding Requirements In addition to program functionality, code readability will also be a require- ment in this program. Any file which you create and/or edit must have your name in a comment at the top of the file. In addition, proper indentation discipline, code documentation, and ease of readability of your code are re- quirements in this assignment. The indentation discipline should closely resemble that of the code provided to you from the grader directory. Documentation will be in the form of comments in your code, written in plain English, such that a person famil- iar with programming in C++, but not familiar with the project will have an easy time understanding the reasoning behind the lines of code that you have written. In addition, all functions that you write should begin with with a plain English comment explaining the input, the results, and a basic, high-level explanation of how the function works. Sample input, program run, and output Content of testoster.txt prior to program run T0 70 75 78 70 100 85 100 90 100 97 93 70 78 97 98 83 96 95 97 70 90 100 83 96 99 70 10070 40 100 100 70 70 70 100 95 70 90 84 79 88 42 0.35 0.4 8 Belvas Strong Cassel Beth 100 8 98 Hardyng Harrold 100 94 Martell Questyn 100 92 Penrose Cortay97 73 Stoneheart Lady 99 88 Thetall Dunk 45 89 90 Waters Aurane 100 64 Sample program rumi a.out testostertit 1: Search 2: Insert 3: Delete 4: Count 5: List all students by name 6: List all studenta by grade Enter choice: 4 There are 8 items in the list 1: Search 2: Insert 3: Delete 4: Count 5: List all studenta by M 6: List all studente by grade 71 exit Enter choice: 5 Begin List 1. Belvas, Strong - D 2. Cassel, Beth - 3. Hardyng. Harrold - B 4. Martell, Quentyn - 3 5. Penrose, Cortnay - C 6. Stoneheart, Lady - B 7. Thetall, Dunk - C 8. Waters, Aurane - F Od List 1: Search 2: Insert 3: Delete 4: Count 5: List all students by name 6: List all students by grade 7: exit Enter choice: 6 -----Begin List 1. Cassel, Beth - 2. Stoneheart, Lady - B 3. Martell, Quentyn - B 4. Hardyng, Harrold-B 5. Thetall, Dunk - 6. Perode, Cortnay - C 7. Belvas, Strong - D 8. Waters, Aurse - F 1: Search Learning Objectives Understand how to create and compile an executable using Makefile Review arrays Introduction to basic database operations Mrs. Niedermeyer is the new physics teacher at East Cornchester High School. She needs a program to help keep records of each of her student's grades. The program needs to do the following: Import student records from the roster file when the program opens Allow the user to search the records to see the grades that a particular student has Allow the user to create a new student record Allow the user to delete a student record I Get a count of the students enrolled in her class . Go through all student records and display a brief record for each stu- dent (both in lexicographical order and in order by grade) When the program exits via option 7, update the roster file so that Mrs. Niedermeyer may pick up where she left off at a later time. Files you have access to Your beloved instructor has lovingly provided you with several files to get you started. The following files are available from the instructor's directory: testRoster.txt: A test file with test data with which you may test your program main.cpp: The c++ file which contains the main program. Ordered List.h: A header file for the Ordered List class Student.h: The header file for the Student class Student.cpp: A set of functions for the Student class. You may download each of the files above with the following command: cp /classes/cs1254/cs1254.laf/progl/". Please note the dot at the end of the command above. That is not a typo, that's part of the command. Also, you should be in the proper directory when you run the download command What you will be responsible for You will create the following files: Ordered List.cpp: A set of functions for the Ordered List class. I Makefile: The file which contains the recipe for creating a out, the executable file that will run the program. Further details about the program The program is menu driven. The program reads a roster file the name of which the user types into the command line. After compiling the program, the program is run by using the following command: a.out (name of roster file) The roster file will start with 4 lines. The first 3 lines will contain real numbers, and the 4th line contains an integer. The first 3 lines each contain a number greater than 0.0 and less than 1.0, and all add up to 1.0. They are the weights of the homework, quizzes, and the final exam respectively. The 4th line shows the number of students in the roster. Each line thereafter contains the data for each student. Each student line contains the student's last name, then a tab, then the first name, then a tab, then 9 integers, each separated by a tab. The first 4 integers in the student line are the grades for each of 4 homework assignment where each grade is out of 100. The following 4 integers in the student line are grades for each of 4 quizzes, where each grade is out of 100. The final integer is the grade for the final exam, which is out of 100. Additional Coding Requirements In addition to program functionality, code readability will also be a require- ment in this program. Any file which you create and/or edit must have your name in a comment at the top of the file. In addition, proper indentation discipline, code documentation, and ease of readability of your code are re- quirements in this assignment. The indentation discipline should closely resemble that of the code provided to you from the grader directory. Documentation will be in the form of comments in your code, written in plain English, such that a person famil- iar with programming in C++, but not familiar with the project will have an easy time understanding the reasoning behind the lines of code that you have written. In addition, all functions that you write should begin with with a plain English comment explaining the input, the results, and a basic, high-level explanation of how the function works. Sample input, program run, and output Content of testoster.txt prior to program run T0 70 75 78 70 100 85 100 90 100 97 93 70 78 97 98 83 96 95 97 70 90 100 83 96 99 70 10070 40 100 100 70 70 70 100 95 70 90 84 79 88 42 0.35 0.4 8 Belvas Strong Cassel Beth 100 8 98 Hardyng Harrold 100 94 Martell Questyn 100 92 Penrose Cortay97 73 Stoneheart Lady 99 88 Thetall Dunk 45 89 90 Waters Aurane 100 64 Sample program rumi a.out testostertit 1: Search 2: Insert 3: Delete 4: Count 5: List all students by name 6: List all studenta by grade Enter choice: 4 There are 8 items in the list 1: Search 2: Insert 3: Delete 4: Count 5: List all studenta by M 6: List all studente by grade 71 exit Enter choice: 5 Begin List 1. Belvas, Strong - D 2. Cassel, Beth - 3. Hardyng. Harrold - B 4. Martell, Quentyn - 3 5. Penrose, Cortnay - C 6. Stoneheart, Lady - B 7. Thetall, Dunk - C 8. Waters, Aurane - F Od List 1: Search 2: Insert 3: Delete 4: Count 5: List all students by name 6: List all students by grade 7: exit Enter choice: 6 -----Begin List 1. Cassel, Beth - 2. Stoneheart, Lady - B 3. Martell, Quentyn - B 4. Hardyng, Harrold-B 5. Thetall, Dunk - 6. Perode, Cortnay - C 7. Belvas, Strong - D 8. Waters, Aurse - F 1: Search

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

Step: 3

blur-text-image

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

Essential Data Protection For Estate Agencies In Singapore 2024

Authors: Yang Yen Thaw Yt

1st Edition

B0CQK79WD3, 979-8872095392

More Books

Students also viewed these Databases questions