Photo AI

Open the incomplete project file called Question1_P.dpr in the Question 1 folder - NSC Information Technology - Question 1 - 2020 - Paper 1

Question icon

Question 1

Open-the-incomplete-project-file-called-Question1_P.dpr-in-the-Question-1-folder-NSC Information Technology-Question 1-2020-Paper 1.png

Open the incomplete project file called Question1_P.dpr in the Question 1 folder. Enter your examination number as a comment in the first line of the Question1_U.pas... show full transcript

Worked Solution & Example Answer:Open the incomplete project file called Question1_P.dpr in the Question 1 folder - NSC Information Technology - Question 1 - 2020 - Paper 1

Step 1

Button [1.1 - Colours]

96%

114 rated

Answer

To implement the button functionality for changing the combo box, you should:

  1. Change the font size of cmbQ1_1 to 12pt.
  2. Add 'Blue' to the combo box cmbQ1_1.
  3. Set the item index of cmbQ1_1 to 0, making 'Green' the default selection.

Step 2

Button [1.2 - Kite]

99%

104 rated

Answer

To calculate the area of the kite, you need to:

  1. Declare a variable rArea to store the area.
  2. Check if idiagA is greater than idiagB.
  3. If true, compute the area using: rArea=idiagA×idiagB2rArea = \frac{idiagA \times idiagB}{2}
  4. Display the result in label formatted to one decimal place.
  5. If false, show an error message.

Step 3

Button [1.3 - Binary number]

96%

101 rated

Answer

To convert an integer to a binary number, follow these steps:

  1. Retrieve the integer from edtQ1_3 and convert it.
  2. Initialize sBinary as an empty string.
  3. While the decimal value is greater than 0, execute:
    • Compute decimalValue MOD 2 to get the remainder.
    • Prepend the remainder to sBinary.
    • Divide the integer value by 2 for the next iteration.
  4. Display the binary string in label lblQ1_3.

Step 4

Button [1.4 - Word game]

98%

120 rated

Answer

For the word game, you need to:

  1. Read the input from edtQ1_4 and convert it to uppercase.
  2. Check if multiple words are entered (look for spaces); if true, clear the input and set focus back to the edit box.
  3. If it’s valid, initialize a score variable.
  4. Loop through each character in the input word:
    • If the character is a vowel, add 3 points.
    • If it’s a consonant, add 2 points.
    • If it’s a special character or space, add 1 point.
  5. Finally, display the total score in a designated output area.

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

;