Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this assignment, I have some of it completed but it still produces mistakes. I have attached my output that I get

I need help with this assignment, I have some of it completed but it still produces mistakes. I have attached my output that I get when i run it, versus what it is supposed to output, I am having trouble with the add and sort function, I need to remove the sort student list function and combine it with the add function to create just one "add" function that adds the students and sorts their names, but I am having trouble with that. I tried uploading my code but Chegg didn't allow it :(

// My output

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

A matthewzamora ssh mzamor11@general.asu.edu 148x40 mzamor11@general4:-/CSE240/d1$ ./test CSE240 HW6 Currently @ student(s) on the list. Enter your selection: a: add a new student d: display student list r: remove a student from the list S: sort student list by name q: quit Enter student name: Steve Enter major: Computer Science (Enter whether students is 'freshman' or 'sophomore' or 'junior' or 'senior': freshman (Please enter student ID number: 123 Student successfully added to the list! Currently 1 student(s) on the list. Enter your selection: a: add a new student d: display student list r: remove a student from the list s: sort student list by name q: quit Student Name: Steve Major: Computer Science Patient Name: not_critical Student ID: 123 Currently 1 student(s) on the list. Enter your selection: a: add a new student d: display student list r: remove a student from the list 5: sort student list by name q: quit Expected output of each function: addsort: Student_list.txt not found. Enter your selection: a: add a new student d: display student list q: quit Enter student name: Eden Hazard Enter major: Computer Science Enter whether students is 'freshman' or 'sophomore' or 'junior' or 'senior': junior Please student ID number: 101 Student successfully added to the list! Enter your selection: a: add a new student d: display student list q: quit Notice that since this is the first execution of the program, load() gave message "Student_List.txt not found. This file is created at the end of the program by save(). (after adding and sorting 3 student details) Enter your selection: a: add a new student d: display student list q: quit Enter student name: William Borges Enter major: Software Engineering Enter whether students is 'freshman' or 'sophomore' or 'junior' or 'senior': senior Please student ID number: 202, Student successfully added to the list! Enter your selection: a: add a new student d: display student list q: quit Enter student name: David Luiz Enter major: Computer Science, Enter whether students is 'freshman' or 'sophomore' or 'junior' or 'senior': freshman Please student ID number: 155 Student successfully added to the list! Enter your selection: a: add a new student d: display student list q: quit display: Enter your selection: a: add a new student d: display student list q: quit Student name: David Luiz Major: Computer Science School year: freshman Student ID: 155 Student name: Eden Hazard Major: Computer Science School year: junior Student ID: 101 Student name: William Borges Major: Software Engineering School year: senior Student ID: 202 Enter your selection: a: add a new student d: display student list q: quit The 3 students seen in display() output above and they are sorted. Use 'd' option to verify sorted result. load: Students record loaded from Student List.txt. Enter your selection: a: add a new student, d: display student list q: quit Student name: David Luiz Major: Computer Science School year: freshman Student ID: 155 Student name: Eden Hazard Major: Computer Science School year: junior Student ID: 101 Student name: William Borges Major: Software Engineering School year: senior Student ID: 202 Enter your selection: a: add a new student d: display student list q: quit Notice the message given by load() Students record loaded from Patient_List.txt" at the top. To verify that load() worked as expected, use 'd' display option to display loaded list. A matthewzamora ssh mzamor11@general.asu.edu 148x40 mzamor11@general4:-/CSE240/d1$ ./test CSE240 HW6 Currently @ student(s) on the list. Enter your selection: a: add a new student d: display student list r: remove a student from the list S: sort student list by name q: quit Enter student name: Steve Enter major: Computer Science (Enter whether students is 'freshman' or 'sophomore' or 'junior' or 'senior': freshman (Please enter student ID number: 123 Student successfully added to the list! Currently 1 student(s) on the list. Enter your selection: a: add a new student d: display student list r: remove a student from the list s: sort student list by name q: quit Student Name: Steve Major: Computer Science Patient Name: not_critical Student ID: 123 Currently 1 student(s) on the list. Enter your selection: a: add a new student d: display student list r: remove a student from the list 5: sort student list by name q: quit Expected output of each function: addsort: Student_list.txt not found. Enter your selection: a: add a new student d: display student list q: quit Enter student name: Eden Hazard Enter major: Computer Science Enter whether students is 'freshman' or 'sophomore' or 'junior' or 'senior': junior Please student ID number: 101 Student successfully added to the list! Enter your selection: a: add a new student d: display student list q: quit Notice that since this is the first execution of the program, load() gave message "Student_List.txt not found. This file is created at the end of the program by save(). (after adding and sorting 3 student details) Enter your selection: a: add a new student d: display student list q: quit Enter student name: William Borges Enter major: Software Engineering Enter whether students is 'freshman' or 'sophomore' or 'junior' or 'senior': senior Please student ID number: 202, Student successfully added to the list! Enter your selection: a: add a new student d: display student list q: quit Enter student name: David Luiz Enter major: Computer Science, Enter whether students is 'freshman' or 'sophomore' or 'junior' or 'senior': freshman Please student ID number: 155 Student successfully added to the list! Enter your selection: a: add a new student d: display student list q: quit display: Enter your selection: a: add a new student d: display student list q: quit Student name: David Luiz Major: Computer Science School year: freshman Student ID: 155 Student name: Eden Hazard Major: Computer Science School year: junior Student ID: 101 Student name: William Borges Major: Software Engineering School year: senior Student ID: 202 Enter your selection: a: add a new student d: display student list q: quit The 3 students seen in display() output above and they are sorted. Use 'd' option to verify sorted result. load: Students record loaded from Student List.txt. Enter your selection: a: add a new student, d: display student list q: quit Student name: David Luiz Major: Computer Science School year: freshman Student ID: 155 Student name: Eden Hazard Major: Computer Science School year: junior Student ID: 101 Student name: William Borges Major: Software Engineering School year: senior Student ID: 202 Enter your selection: a: add a new student d: display student list q: quit Notice the message given by load() Students record loaded from Patient_List.txt" at the top. To verify that load() worked as expected, use 'd' display option to display loaded list

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

=+What category does this metric represent?

Answered: 1 week ago