Photo AI

1.1 – Gender Set the caption to "Gender" Add the option "Male" Set the Columns property to 2 1.2 – Random day Declare an integer variable for the random number - NSC Information Technology - Question 1 - 2024 - Paper 1

Question icon

Question 1

1.1-–-Gender-Set-the-caption-to-"Gender"-Add-the-option-"Male"-Set-the-Columns-property-to-2--1.2-–-Random-day-Declare-an-integer-variable-for-the-random-number-NSC Information Technology-Question 1-2024-Paper 1.png

1.1 – Gender Set the caption to "Gender" Add the option "Male" Set the Columns property to 2 1.2 – Random day Declare an integer variable for the random number. Gen... show full transcript

Worked Solution & Example Answer:1.1 – Gender Set the caption to "Gender" Add the option "Male" Set the Columns property to 2 1.2 – Random day Declare an integer variable for the random number - NSC Information Technology - Question 1 - 2024 - Paper 1

Step 1

1.1 – Gender

96%

114 rated

Answer

To set the caption to 'Gender', access the button properties in your code editor and modify the 'Caption' attribute accordingly. Then, add the option 'Male' to the dropdown list in the same properties panel. Finally, set the 'Columns' property to 2 to ensure proper display layout of the options.

Step 2

1.2 – Random day

99%

104 rated

Answer

Declare an integer variable 'randomNumber' to store the random value. Use a random number generator function to assign a value between 1 and 7. Display this value by concatenating 'Day: ' with the converted string of 'randomNumber' in label 'biol1_2'. To determine if the day is a weekend, implement a conditional statement: if 'randomNumber' equals 1 or 7, show 'Weekend' in 'editQ1_2', otherwise display 'Weekday'.

Step 3

1.3 – Calculate

96%

101 rated

Answer

Declare suitable variables including 'rBonus' for the calculated bonus. Retrieve the number of years from the spin edit control. The bonus can be calculated as follows:

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

To verify if a checkbox is selected, check its state. If selected, adjust 'rBonus' accordingly, either by multiplying it by 1.1 or by adding 10% of it (0.1 * 'rBonus'). Finally, present this 'rBonus' value in a message box, formatting it to show currency with two decimal places.

Step 4

1.4 – Title case

98%

120 rated

Answer

Begin by appending a space to the end of the input sentence to simplify the loop termination. Initialize a string variable for 'word'. The loop should iterate through each character of 'sSentence'. For each character, check if it is a space; if not, convert the first letter to uppercase and construct the title case version. Display the modified word in 'redQ1_4'. Once the word is formatted, you can delete it from the original index or clear any previous entries.

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

;