Photo AI

1.1 Add the picture, Medical.jpg, as a dynamic component when the program is executed - NSC Information Technology - Question 1 - 2017 - Paper 1

Question icon

Question 1

1.1-Add-the-picture,-Medical.jpg,-as-a-dynamic-component-when-the-program-is-executed-NSC Information Technology-Question 1-2017-Paper 1.png

1.1 Add the picture, Medical.jpg, as a dynamic component when the program is executed. Properties: Left = 500 Top = 15 Height = 90 Width = 120 Stretch = True 1.2 G... show full transcript

Worked Solution & Example Answer:1.1 Add the picture, Medical.jpg, as a dynamic component when the program is executed - NSC Information Technology - Question 1 - 2017 - Paper 1

Step 1

1.1 Add the picture, Medical.jpg, as a dynamic component when the program is executed.

96%

114 rated

Answer

To add the dynamic component, use the following code:

Imgmedical := TImage.Create(frmQuestion1);
Imgmedical.Parent := frmQuestion1;
Imgmedical.Left := 500;
Imgmedical.Top := 15;
Imgmedical.Height := 90;
Imgmedical.Width := 120;
Imgmedical.Stretch := True;
Imgmedical.Picture.LoadFromFile('medical.jpg');
Imgmedical.Visible := True;

Step 2

1.2 General Info Button:

99%

104 rated

Answer

To implement the General Info Button logic:

  1. Get the title, name, and surname from the edit box.
  2. Retrieve the ID number and check if it's 13 characters long. If it's not, display a suitable message.
  3. Check if the ID contains only numbers. If it doesn't, display a warning message.
  4. If valid, create a file name using the first three characters of the surname and a random number between 100 and 999.
  5. Display a welcome message incorporating the title, initials, surname, and the generated file name.

Step 3

1.3 Medical Aid Info Button:

96%

101 rated

Answer

The Medical Aid Info Button should work as follows:

  1. Check if the Main Member checkbox is selected; if true, display 'Main Member'.
  2. If the subsidy checkbox is selected, store 'Yes', otherwise store 'No'.
  3. Get the number of dependents and the medical aid name from the list box.
  4. Write the information to the text file using the file name created in Question 1.2. Make sure each piece of information is on a separate line:
<file name>: (Main Member)
<number of dependents>
<medical aid name>
<subsidy>
  1. Close the file and display a message indicating that the information has been successfully written.

Step 4

1.4 Update Info Button:

98%

120 rated

Answer

For the Update Info Button implementation:

  1. Retrieve the current system date, their modification date, and increment it by one year.
  2. Create the output message that informs the patient when they need to update their information again, utilizing the incremented date.
  3. Display the message in an appropriate format.

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

;