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 1
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
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
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
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Declare an integer variable for the random number.
Generate a random number within the range of 1 to 7.
Display "Day:" followed by the random number converted to a string in the label labeled "lblQ1_2".
If the random number equals 1 or 7, display "Weekend" in "editQ1_2".
Otherwise, display "Weekday" in "editQ1_2".
Step 3
Button [1.3 – Calculate]
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Declare suitable variables for the calculation.
Extract the number of years from the spin edit control.
Calculate the bonus using the formula:
rBonus:=Power(P,iYears)
or
rBonus:=extSQRT(P)/7∗20
If the checkbox is ticked, apply the respective formulae to adjust the bonus.
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
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
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.
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".