project
Project – Part 4 – Arrays
Constant Integer SIZE =20
Main module
Declare Integer studentID [SIZE]
Declare Integer courses [SIZE]
Declare real cost [SIZE]
Declare Integer index
Declare real totalBill
For index=0 to SIZE-1
Display “Please enter your student ID”, index+1
Input studentID[index]
Display “How many course you are taking?”
Input courses[index]
Display “The cost of your course”
Input cost[index]
End for
Set totalBill= cost[i]*courses[i]
Display “The total bill of you is”
For i=1 to 10
Display “Student ID:”, studentID[index], “Course your taking”, courses[i],
“and the total cost is”, totalBill, “.”
End
Start
Constant Integer SIZE =20
Declare Integer studentID [SIZE]
Declare Integer courses [SIZE]
Declare real cost [SIZE]
Declare Integer index
Declare real totalBill
Set index=0