Science · Paper 2 · 2019
4 questions 🇹🇿 NECTA ✓ MS3-hour timed simulation · auto-graded · counts toward ranking
Pay & start exam →Questions (4)
Section A
Interface description: The time interval for the clock should be 1 second. The font type and size of the time displayed should be “Courier New” and 48 points respectively. The “Alarm On” or “Alarm Off” message should be displayed on the program with font type “MS Sans Serif”. Font size 18 points and bolded. (ii) Write Visual Basic codes which will activate the interface created in part (a) (i) in order to: Produce a sound when the “Alarm On” option is selected. Switch off the alarm sound by clicking the “Alarm Off” option. Display a message that informs a user if the alarm is “On” or “Off” after setting an alarm and clicks the desired option button. (iii) Save your work as “Vb Alarm”.
- Describe the interface elements and their properties as per the given description. (0 mk)
- Construct a C++ program that will convert the lengths entered by a user to centimeters. The program should prompt a user to enter two integer values, the first value for feet and the second value for inches. The program should display the numbers entered by the user, total number of inches and total centimeters. Use suitable messages to display the output. Hint: • One inch is equal to 2.54 centimeters. • One foot is equal to 12 inches. (0 mk)
- Use switch….case statement and while loop to construct a C++ program that reads the letter codes A to Z and prints the corresponding telephone digits. A program should stop when a user keys symbol #. The letter codes and their corresponding telephone digits are given in Table 1. (0 mk)
- Write Visual Basic codes which will activate the interface created in part (a) (i) in order to: * Produce a sound when the “Alarm On” option is selected. * Switch off the alarm sound by clicking the “Alarm Off” option. * Display a message that informs a user if the alarm is “On” or “Off” after setting an alarm and clicks the desired option button. (0 mk)
- Save your work as “Vb Alarm”. (0 mk)
Upgrade to see model answers.
Section B
(b) (i) Use Visual Basic program to create the following Calendar viewer interface: Hint: Use Month View and TextBox controls to display the calendar and the current date. (ii) Write Visual Basic codes which will display the date picked/clicked by the user in the text box using the format “MM/DD/YYYY” as shown in part (b) (i).
- Use Visual Basic program to create the following Calendar viewer interface: Hint: Use Month View and TextBox controls to display the calendar and the current date. (0 mk)
- Write Visual Basic codes which will display the date picked/clicked by the user in the text box using the format “MM/DD/YYYY” as shown in part (b) (i). (0 mk)
- Save your work as “Vb Alarm”. (0 mk)
Upgrade to see model answers.