Project – Part 5 – ArraysModify the pseudocode design created in Part 4 (attached) to include at least the following
modules.
·
Enter the ClassTitle into an array named Classes and NumberofSeats into an
array named ClassSeats. (ClassSeats = -999 when end the file is reached)
·
Update Classes inventory (add to inventory/deduct from inventory)
·
Calculate and print the student’s bill.
·
Calculate and print the total number of students in each class.
·
Calculate and print the average number of students in each class.
The student will be prompted to enter their student ID and whether they want to add a class,
drop a class or display their schedule.
Add a class – after the student has finished entering the class title(s), the system will calculate
and print the bill.
Drop a class – a message is printed on the screen after dropping the class.
Modify the hierarchy chart to include the new modules. Save the hierarchy chart in a separate
file.
Save the pseudocode design in a separate file and label both files with what they are.
// Constant for the array sizes.
Constant Integer SIZE = 3
// Array to hold courses
Declare String courses = [Size]
// Array to hold cost = [Size]
Declare Real Cost = [Size]
// Get each class information
For index = 0 To Size – 1
Display courses [index]
Display cost [index]
End For
End
// Variable to hold the number of courses.
Declare Real coursesAmount
// Variable to hold the courses Cost.
Declare Real couresCost
// Get each class information
For index = 0 To Size – 1
// Get Class name.
Display “Enter name of the class”, index + 1
Input class name [index]
End For
// Get the courses cost.
Display “Enter the cost of courses”
Input courses cost
// Display each courses total cost.
Display “Here is each total cost”
For index = 0 To SIZE – 1
Set coursesName = className [index} * cost
Display courses[name], “:”, currencyFormat (Total bill)
———————————————————————————————-
Hierarchy chart
Start
|
Constant Integer SIZE = 3
Declare String courses [SIZE]
Declare Real courses cost
Declare Real total cost
Declare Integer index
|
Set Index = 0
|
index