Question
C++. Full code needed. Please abide by all instructions. Pseudocode is included. Please include anything that may have been left out. Thanks! // Vector pseudocode
C++. Full code needed. Please abide by all instructions. Pseudocode is included. Please include anything that may have been left out. Thanks!
// Vector pseudocode
Open file containing course information
Create empty vector to store course objects
Read each line
WHILE file has a next line
Parse each line
Verify at least two parameters on each line
IF (parameters.size()
Display ERROR message
END
Check if prerequisite exists as a course in the file
for p in prerequisites:
found = false
for c in courses:
if (c.courseNumber == p):
found = true
break
IF not found
Display ERROR
END
Create course object
Store course object in vector
CLOSE FILE
Function for searching for a specific course and Display information
Search for the course in the vector
for c in courses:
IF (c.courseNumber == courseNumber)
Print course information
Print prerequisite course information
Verify at least two parameters on each line
IF (parameters.size()
Display ERROR
END
Check if prerequisite exists as a course in the file
for p in prerequisites:
found = false
for c in courses:
IF (c.courseNumber == p):
found = true
BREAK
IF not found
Display ERROR
END
Create a course object
Store course object in vector
CLOSE FILE
Function for searching for a specific course and printing its information and prerequisites
void printCourseInformation(vector
Search for the course in the vector
for c in courses:
if (c.courseNumber == courseNumber)
Display course information
Display prerequisite course information
// Hashtable pseudocode
open file "courseInformation.csv" for reading
IF file does not exist
Display ERROR and exit
ELSE
create empty hash table "courses"
WHILE a line exists in file
read line
split line into tokens
IF number of tokens is
display ERROR
continue to next line
END IF
IF first token not a number
display ERROR
continue to next line
END IF
IF a third token exists
IF third token not a number
Display ERROR
continue to next line
END IF
check if third token is a key in "courses"
IF not
Display ERROR
continue to next line
END IF
END IF
create new course object with first token as course number, second token as course title, and third as prerequisite
insert course object into "courses" with course number as key
END WHILE
END IF
CLOSE FILE
Create course objects and store in Hash Table
class Course
courseNumber
courseTitle
prerequisite
constructor(courseNumber, courseTitle, prerequisite)
this.courseNumber = courseNumber
this.courseTitle = courseTitle
this.prerequisite = prerequisite
END constructor
END class
Create empty hash table named "courses"
FOR each line
create new course object with line tokens as arguments
insert course object into "courses" with course number as key
END FOR
FOR each key in "courses" hash table
retrieve course object from "courses" hash table
Display courseNumber, courseTitle, and prerequisite
END FOR
Define function to display course info and prerequisites
loop through hash table
FOR (int i = 0; i
IF current index not empty
Create pointer to head of linked list at current index
loop through linked list at current index
Display the course number, title, and prerequisites
loop through prerequisites of the current course
Display prerequisite course number
END WHILE
move to next course in linked list
END IF
END FOR
END
// Tree pseudocode
open file "courseInformation.csv" for reading
IF file does not exist
Display ERROR and exit
ELSE
create empty tree data structure "courses"
WHILE a line exists in file
read line
split line into tokens
IF number of tokens is
display ERROR
continue to next line
END IF
IF first token not a number
display ERROR
continue to next line
END IF
IF a third token exists
IF third token not a number
Display ERROR
continue to next line
END IF
Check if third token exists as a node in "courses"
IF not
Display ERROR
continue to next line
END IF
END IF
create new course object with first token as course number, second token as course title, and third as prerequisite
insert course object as a node in "courses" with the prerequisite as its parent node
END WHILE
END IF
CLOSE FILE
Create course objects and store in Tree Data Structure
class Course
courseNumber
courseTitle
prerequisite
constructor(courseNumber, courseTitle, prerequisite)
this.courseNumber = courseNumber
this.courseTitle = courseTitle
this.prerequisite = prerequisite
END constructor
END class
Define function to traverse and display course info and prerequisites
function displayCourses(node)
display courseNumber, courseTitle, and prerequisite of current node
IF node has children
FOR each child of node
call displayCourses function with child as argument
END FOR
END IF
END
call displayCourses function with root node of "courses" tree data structure as argument
// Menu pseudocode
LOAD data from "courses.txt" into vector courses
END
SORT courses in ascending order
DISPLAY courses in ascending order
END
Find the course with given code
FOR c in courses
IF code == course code
DISPLAY title and prerequisite
END
END
END
// Main function
DISPLAY Menu options for user
DISPLAY option to load data
DISPLAY option to print course list
DISPLAY option print course
DISPLAY "4. Exit"
GET user choice
SWITCH user choice
CASE 1:
Load data structure
BREAK
CASE 2:
DISPAY course list
BREAK
CASE 3:
DISPLAY instructions to enter code
GET course code from user
DISPLAY course
BREAK
CASE 4:
END and EXIT
Scenario The academic advisors in the Computer Science department at ABCU are very happy with the planning and design you have completed for the advising assistance software. They have decided they would like you to move forward with writing the code for the application so the department advisors can start using this to help when they talk with students. Directions All of your coding will be completed in the integrated development environment (IDE). Additional references on the use of this IDE are linked in the Supporting Materials section. As you begin coding, you will be using the data structure that you recommended in Project One to complete the following. 1. Input: Design code to correctly read the course data file. The program you will submit will be a command-line program written in C++. You will prompt the user to ask for the file name that contains the course data and read that file into course objects that are stored in your chosen data structure. Your data structure will hold course objects. 2. Menu: Design code to create a menu that prompts a user for menu options. The menu should include the following options: a. Load Data Structure: Load the file data into the data structure. Note that before you can print the course information or the sorted list of courses, you must load the data into the data structure. b. Print Course List: This will print an alphanumeric list of all the courses in the Computer Science department. c. Print Course: This will print the course title and the prerequisites for any individual course. d. Exit: This will exit you out of the program. 3. Loading Data Structure: Develop working code to load data from the file into the data structure. 4. Course List: Develop working code to sort and print out a list of the courses in the Computer Science program in alphanumeric order (including all math courses). To print out a course list, use the pseudocode you created previously to guide your work. Then, create code that will allow advisers to print a course list in alphanumeric order. Remember that this code should do the following: a. Sort the course information alphanumerically from lowest to highest. b. Print the sorted list to a display. 5. Course Information: Develop working code to print course information. This code should allow users to look up a course and print out information about its title and prerequisites. Your program will need to prompt the user to enter the courseNumber. You will then print out the name of the course along with the prerequisite courseNumbers and titles. See Project Two Sample Program Output in the Supporting Documents section. 6. Industry Standard Best Practices: Apply industry standard best practices in code design. Your program should display an error message when user input does not fall within parameters. You should also use in-line comments and appropriate naming conventions to enhance readability and maintainability. What to Submit To complete this project, you must submit the following: Advising Assistance Program Submit all of your C++ code that is needed to implement the project in a single ZIP file. Make sure the code compiles and runsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started