3-3 Milestone_ Vector Data Structure Pseudocode (1)

docx

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

CS-210

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

3

Uploaded by CoachTree4507

Report
Zachary Bowen CS-300 Nov 13, 2023 Module 3 Milestone: Pseudocode for ABCU Project One Load text parsing libraries and headers Define a struct to hold course data struct Course {} courseID courseName preCount preList Course() (constructor) {courseID = courseName = ””; preCount = 0; preList = “”} Main() Create new List named courseList of the struct-type Course Get CSV file path from user If no data passed use default location Call txtParser() passing CSV file path Call validateList() passing courseList Get user value to search for and Store in userSearch Call printCourse() passing userSearch End txtParser(String) Create a local List named tempList Open file found at the path in String by invoking parser libraries
Loop row by row until end of file (eof) If first and second string are present Add the first String to struct at courseID Add the second String to Struct at courseName Loop until file handler has no value in a column (indicates no more prerequisite) Increment a variable named preCount for each prerequisite found Concatenate a localString named preNames for each prerequisite Add preCount to struct at preCount Add preNames to struct at preList Return tempList End searchList(String) Create tempCourse of type Course Loop through list For Each Course If String is the same as courseID Set tempCourse to Course Return tempCourse End printCourse(String) Create tempCourse of type Course Set tempCourse equal to searchList(String) Output courseID to console Output courseName to console Loop 0 to preCount For each Course in preList Call printCourse() passing preList
End validateList() Create tempCourse of type Course Create variable valid and Set to True For Each Course If valid is False break Loop 0 to preCount Set tempCourse equal to searchList(preList token) If tempCourse courseID is empty Set valid to False Return valid End
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help