lOMoARcPSD|8112944
INF 2611
VISUAL PROGRAMMING II
GROUP PREPARATION QUIZ
EXAM 2020
, lOMoARcPSD|8112944
INF2611 Group 1E Exam Preparation Quiz 1
(INF2611_2020_S2-G1E)
1. What are widgets and why are they useful in programming? (2 Points)
The main component for creating a user interface are widgets, such as buttons, menus and scrollbars. They are used for
receiving user input but also to display data and status information. Widgets can also be nested inside another.
2. Name any 3 widgets that you have used in your assignments. (3 Points)
You used among others these widgets:
Clock widget
Calendar
Displaying information in a table
Displaying graphics
3. Explain how you would add a LCD widget and how you can use this to show the system time. (5
Points)
To use the Clock widget you use the methods:
Use the setMode() method, to change the base of the numbers. Available options are Hex, Dec, Oct, Bin.
Use the display() method to display the content as LCD digits.
Use the value() method that can return the numerical value displayed by the LCD Number widget.
For the system clock time displayed, to update automatically, you are required to implement timers.
4. Explain how you would add a calendar widget and how you can use this to display the date
selected in a date edit widget. (3 Points)
To use the calendar widget you use the methods:
Use method selectedDate() that returns the currently selected date.
Use method monthShown() that return the currently displayed month.
Use method yearShown() that returns the currently selected year.
Use method setFirstDayOfWeek() to set the day in the first column.
Use method selectionChanged() when you select a date other than the selected date.(example selecting date by mouse or
keyboard).
You can change various properties in the Calendar Widget such as minimumDate, maximumDate, selectionMode etc.
5. Why is a combobox useful in applications? (1 Point)
Combobox is an input widget, that displays a pop-up list. It forces the user to use only values available in the pop-up
list. Which means it controls user input and ensures validity and accuracy of input.
6. Explain how you can use a combo box in a GUI. (3 Points)
You can use a combo box to display listed items.
You can use it to change an item.
Remove an item
Add an item to the list
INF 2611
VISUAL PROGRAMMING II
GROUP PREPARATION QUIZ
EXAM 2020
, lOMoARcPSD|8112944
INF2611 Group 1E Exam Preparation Quiz 1
(INF2611_2020_S2-G1E)
1. What are widgets and why are they useful in programming? (2 Points)
The main component for creating a user interface are widgets, such as buttons, menus and scrollbars. They are used for
receiving user input but also to display data and status information. Widgets can also be nested inside another.
2. Name any 3 widgets that you have used in your assignments. (3 Points)
You used among others these widgets:
Clock widget
Calendar
Displaying information in a table
Displaying graphics
3. Explain how you would add a LCD widget and how you can use this to show the system time. (5
Points)
To use the Clock widget you use the methods:
Use the setMode() method, to change the base of the numbers. Available options are Hex, Dec, Oct, Bin.
Use the display() method to display the content as LCD digits.
Use the value() method that can return the numerical value displayed by the LCD Number widget.
For the system clock time displayed, to update automatically, you are required to implement timers.
4. Explain how you would add a calendar widget and how you can use this to display the date
selected in a date edit widget. (3 Points)
To use the calendar widget you use the methods:
Use method selectedDate() that returns the currently selected date.
Use method monthShown() that return the currently displayed month.
Use method yearShown() that returns the currently selected year.
Use method setFirstDayOfWeek() to set the day in the first column.
Use method selectionChanged() when you select a date other than the selected date.(example selecting date by mouse or
keyboard).
You can change various properties in the Calendar Widget such as minimumDate, maximumDate, selectionMode etc.
5. Why is a combobox useful in applications? (1 Point)
Combobox is an input widget, that displays a pop-up list. It forces the user to use only values available in the pop-up
list. Which means it controls user input and ensures validity and accuracy of input.
6. Explain how you can use a combo box in a GUI. (3 Points)
You can use a combo box to display listed items.
You can use it to change an item.
Remove an item
Add an item to the list