Pre-release Flashcards

1
Q

Data structures in Task1

A
STRING  firstName[1000]
STRING surname[1000]
CHAR volunteerInfo[1000]
INTEGER yearJoined[1000]
CHAR paid[1000]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Variables in Task1

A

INTEGER numMembers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Task 1

A

OUTPUT “Enter first name: “
INPUT firstNames[numMembers]

OUTPUT “Enter surname: “
INPUT surnames[numMembers]

OUTPUT “Do they wish to volunteer (y/n): “
INPUT volunteerInfo[numMembers]

IF volunteerInfo[numMembers] = ‘y’ THEN
OUTPUT “Choose Pier Gate (g), Gift Shop (s) Painting or Decorating (p): “
INPUT volunteerInfo[numMembers]
ENDIF

OUTPUT “Enter year joined (yyyy): “
INPUT yearJoined[numMembers]

OUTPUT “Has the member paid (y/n): “
INPUT paid[numMembers]

numMembers ← numMembers + 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Task 2

A

OUTPUT “1. Members who are volunteers”
OUTPUT “2. Volunteers who work at the pier entrance gate”
OUTPUT “3. Volunteers who work in the gift shop.”
OUTPUT “4. Volunteers who help with painting and decorating tasks.”
OUTPUT “5. Members whose membership have expired (not re-joined this year).”
OUTPUT “6. Members who have not yet paid their $75 fee.”

OUTPUT “Enter choice (1 - 6): “
INPUT choice

FOR i ← 0 TO numMembers STEP 1

IF choice = “1” AND volunteerInfo[i] <> ‘n’ THEN
OUTPUT firstNames[i], “ “, surnames[i])
ELSE IF choice = “2” AND volunteerInfo[i] = ‘g’ THEN
OUTPUT firstNames[i], “ “, surnames[i])
ELSE IF choice = “3” AND volunteerInfo[i] = ‘s’ THEN
OUTPUT firstNames[i], “ “, surnames[i])
ELSE IF choice = “4” AND volunteerInfo[i] = ‘p’ THEN
OUTPUT firstNames[i], “ “, surnames[i])
ELSE IF choice = “5” AND yearJoined[i] < CurrentYear() THEN
OUTPUT firstNames[i], “ “, surnames[i])
ELSE IF choice = “6” AND paid[i] = ‘n’ THEN
OUTPUT firstNames[i], “ “, surnames[i])
ENDIF
NEXT i

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Data structures for Task3

A

STRING sponsorNames[1000]

STRING sponsorMessages[1000]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Variables for Task3

A

INTEGER numSponsors ← 0

STRING confirm ← “”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Task 3

A

REPEAT
OUTPUT “Enter full name: “
INPUT sponsorNames[numSponsors]

OUTPUT “Enter message: “
INPUT sponsorMessages[numSponsors]

OUTPUT “Name: “, sponsorNames[numSponsors])
OUTPUT “Message: “, sponsorMessages[numSponsors])

OUTPUT “Confirm above details are correct (y/n): “
INPUT confirm
UNTIL confirm = “y”

numSponsors ← numSponsors + 1

OUTPUT “Details saved ….”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain Task 2

A

1) Output a menu detailing the categories that the user can choose from to find the last and first names of the members that fit within them
2) Prompt the user to enter their choice of category
3) Store the number of the category they wish to view in the variable INTEGER choice
4) Iterate through the amount of members
5) a) Inside the loop, check if the choice variable is equal to one and the and the variable volunteerInfo isn’t equal to ‘n’
b) If the statement is correct, use the loop counter to output the names of the members that fit into the character, by outputting variable ‘firstName’ and ‘surname’
6) a) If it isn’t, then check if the choice variable is equal to 2 and if the volunteerInfo is equal to ‘g’
b) b) If the statement is correct, use the loop counter to output the names of the members that fit into the character, by outputting variable ‘firstName’ and ‘surname’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain Task 3

A

1) Set up a Repeat… Until loop so that the code loops through at least once
2) In the loop , prompt the user to enter the name of the sponsors. Store the integer in the array sponsorNames[numSponsors]
3) Prompt the user to enter the name of the person who wishes to sponsor the pier. Store the string in the array sponsorNames[numSponsors]
3) output the name of the sponsor and the sponsor message that has been stored
4) Prompt the user to enter if the details they entered are correct(y/n). Store the char in the variable confirm
5) Repeat this loop until confirm = ‘y’
6) Increment the count the amount of sponsors by 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Constant variables

A

CONSTANT REAL MemberCost

How well did you know this?
1
Not at all
2
3
4
5
Perfectly