Photo AI

You are organising a small LAN event - NSC Information Technology - Question 5 - 2017 - Paper 2

Question icon

Question 5

You-are-organising-a-small-LAN-event-NSC Information Technology-Question 5-2017-Paper 2.png

You are organising a small LAN event. The participants will have to complete a registration form. The information will be used to keep track of their results as well... show full transcript

Worked Solution & Example Answer:You are organising a small LAN event - NSC Information Technology - Question 5 - 2017 - Paper 2

Step 1

5.1 Write an algorithm to create the access code.

96%

114 rated

Answer

  1. Retrieve the user's name and surname.
  2. Initialize an empty string for the access code.
  3. Loop through each character in the name and surname:
    • If the character is a vowel (a, e, i, o, u) or a space, skip it.
    • If it is a consonant, append it to the access code string.
  4. Change the first character of the access code to uppercase.
  5. Change the last character of the access code to uppercase.
  6. Append a '#' at the end of the access code.
  7. Return the access code.

Step 2

5.2.1 What does the ':' indicate?

99%

104 rated

Answer

The ':' indicates that the attributes are private fields in the UML diagram.

Step 3

5.2.2 What is the difference between a mutator and accessor method? Give an example of each making use of objLAN.

96%

101 rated

Answer

Accessor methods retrieve the values of an object's fields without modifying them (e.g., GetTeamName). Mutator methods change the values of an object's fields (e.g., CalculateCost).

Step 4

5.2.3 What is the purpose of a constructor?

98%

120 rated

Answer

A constructor instantiates the object and initializes the fields of the object with default or provided values.

Step 5

5.2.4 What is the purpose of a toString method?

97%

117 rated

Answer

The toString method compiles the object's attributes into a single string variable for easy representation.

Step 6

5.3 Draw a trace table.

97%

121 rated

Answer

EngineCountNumberSizeAverageOUTPUT
0001.8--
1.8112.0--
3.8221.0--
4.8331.3--
6.1441.0--
7.1552.5--
9.6662.0--
11.6771.3--
12.9881.8--
..................
16.5......-1--

Join the NSC students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;