You are on page 1of 5

Mainline Code

Start
Declerations
Num currentUser
Num indexNumb
String CurrentName
String studentNames[300]
String statusAdmission[300]
Num currentTime
Num studentTemp
Num choice
Num accessStatus
Num placementNumber
//In the first part it asks in which part of the program you want to go, if any other
number is entered it will display an error and end the program
Ouput “Do you wish to review a students status or fill in a survey” 1 for
status, 2 for survey”
Input choice

If choice = 1
studentStatus(placementNumber)
Output “Student”+””+studentNames[placementNumber]+””+”Status:”+
StatusAdmission[placementNumber]
//If choice 2 has been picked, it runs the mainline logic for the Student survey
itself. In the student survey it runs a method for each check, if everything is well
the accessCheck variable will be zero and allow the student on campus while
adding his status tp the parralel string.
Else If choice = 2
output “Welcome to the student survey”
currentUser = currentUser + 1
If currentUser > 300
Ouput “Capacity has been reached”
stop program
Else
Output “Is it past 12pm? 1 for Yes,2 for No”
Input currentTime
timeCheck(currentTime,accessStatus)

output “Please enter your name”


Input currentName
StudentNames[currentUser -1] = currentName

Output "Please enter your temperature, without a decimal”


Input currentTemp
tempCheck(currentTemp,accessStatus)
Endif
If accessStatus > 0
StudentAdmission[currentUser –1 ] = Access Denied
Output “You are not allowed on campus”
Else
StudentAdmission[currentUser –1 ] = Access Granted
Ouput “You are allowed on Campus”
Endif
//Here it comes back to the first choice made in the program, if any other number
is chosen it errors, and ends the program
Else
“Error please enter a correct number”

Endif
Stop

Methods
//This is the first method used, for the second option on the menu to check for a
student’s status.
StudentStatus(placementNumber)
Declerations
Num currentNumb = 0
Num whichStudent
Output “while student would you like to view?”
Input whichStudent
While whichStudent NOT = studentNames[currentNumber]
CurrentNumber+1
Stopwhile
PlacementNumber = currentNumber
Return placementNumber

//First check is the time check, that if its passed 12, will add to the access status
which in turn will later be checked to deny acess to the campus
timeCheck(currentTime)
If currentTime = 1
accessStatus = accessStatus +1
return accessStatus
Else
return accessStatus

//Here it checks the temperature, if its too high, will add to the access status
which in turn will later be checked to deny acess to the campus
tempCheck(currentTemp)
If currentTemp >= 38
accessStatus = accessStatus +1
return acccessStatus
Else
return accessStatus

You might also like