Photo AI

1. Button [1.1 – Gender] Set the caption to "Gender" Add the option "Male" Set the Columns property to 2 2 - NSC Information Technology - Question 1 - 2024 - Paper 1

Question icon

Question 1

1.-Button-[1.1-–-Gender]-Set-the-caption-to-"Gender"-Add-the-option-"Male"-Set-the-Columns-property-to-2--2-NSC Information Technology-Question 1-2024-Paper 1.png

1. Button [1.1 – Gender] Set the caption to "Gender" Add the option "Male" Set the Columns property to 2 2. Button [1.2 – Random day] Declare an integer variable fo... show full transcript

Worked Solution & Example Answer:1. Button [1.1 – Gender] Set the caption to "Gender" Add the option "Male" Set the Columns property to 2 2 - NSC Information Technology - Question 1 - 2024 - Paper 1

Step 1

Button [1.1 – Gender]

96%

114 rated

Answer

Set the button caption to "Gender". Add an option labeled "Male" and ensure that the columns property is set to 2.

Step 2

Button [1.2 – Random day]

99%

104 rated

Answer

  1. Declare an integer variable for the random number.
  2. Generate a random number within the range of 1 to 7.
  3. Display "Day:" followed by the random number converted to a string in the label labeled "lblQ1_2".
  4. If the random number equals 1 or 7, display "Weekend" in "editQ1_2".
  5. Otherwise, display "Weekday" in "editQ1_2".

Step 3

Button [1.3 – Calculate]

96%

101 rated

Answer

  1. Declare suitable variables for the calculation.

  2. Extract the number of years from the spin edit control.

  3. Calculate the bonus using the formula:

    rBonus:=Power(P,iYears)rBonus := Power(P,iYears)

    or

    rBonus:=extSQRT(P)/720rBonus := ext{SQRT}(P) / 7 * 20

  4. If the checkbox is ticked, apply the respective formulae to adjust the bonus.

  5. Display the final bonus in a dialog box formatted to currency with two decimal places.

Step 4

Button [1.4 – Title case]

98%

120 rated

Answer

  1. Use a for loop to iterate through the characters of the input sentence:
    • Add a space at the end of the sentence to ensure proper handling of the last word.
    • Initialize a word string.
  2. For each character in the sentence:
    • If the character is not a space, convert the first letter of the word to uppercase.
    • Display the converted word in the designated area, "redQ1_4".
    • Clear the word string for the next iteration.

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

;