Prog 512 (2.2)
Prog 512 (2.2)
Page 1 of 5
SECTION A: (THIS SECTION IS COMPULSORY) (40 MARKS)
1.1 Design a windows desktop application and write the code that will execute according to
the program requirements shown below. The purpose of the application is to computes
the yearly cost of commuting to work via Uber car services, subways or bus. The user
selects how she comute to work and then answers questions based on that response to
comute the cost of traveling to and from work for one year in a city.
1.1.1 The user first views a windows application with a title and a ComboBox object
that asks how she commutes – Uber, subway or bus. The other objects on the
form are not active at this time. (10)
1.1.2 After the user selects the mode of travel, the questions related to that type of
travel are displayed immediately. (10)
2.2 The following customized questions are displayed based on the user’s choice;
Uber; Daily round trip cost using Uber, days worked per month. When you
compute the Uber cost, increase the cost by 20 percent to cover surge pricing.
Surge pricing is when fares temporarily increase to encourage more Uber
drivers to get on the road and head to area of the city where demand for rides
is high.
Subway; Round trip transit fare and days worked per month.
Bus; Round trip transit fare and days worked per month.
2.2.1 After the values have been validated, calculate the cost of commuting for one
year for the selected choice. User entry and cost must be saved to the text file
called Cost. (15)
2.2.2 All the values that the user enters should be validated. (5)
Create a Login System that uses Admin as a Username and Admin1 as Password like the
picture below. If details are correct, application will then grant user to the next form. The
second form would accept Student Info and will allow user to save data to Access
Database called StudentInfo.accdb. The name of the table should be Students. The ICAS
No should be random number from range 1000 to 5000.
Page 2 of 5
(30)
(15)
Fig 3.1
Page 3 of 5
3.2 Design a form like the one shown in Figure 3.2:
- Search Button: allow user to enter information and search through the
database.
- Next & Previous Button: Allow user move between records. (15)
4.1 You have just been employed as an IT programmer at ITIHub, an IT security company. You
are given the responsibility to handle the following tasks: create a sequential file
consisting of employee names and then display the entire contents of the file in a list box.
4.1.1 Create a sequential file consisting of names of the company’s employees and then
display the entire contents of the file in a list box. (excluding contents in list box)
(5)
Page 4 of 5
4.1.2 Write code under the Create File button to create a new file called employee.txt (8)
containing the names from Patel to Gopee as in the list box.
4.1.3 Write code under the Display File button to display the captured names from the (7)
file employee.txt containing the names from Patel to Gopee as in the list box
4.1.4 To enhance your system, add message box to show all data captured, and if all (5)
documents entered.
4.1.5 Add a menu control, with FILE in it add CLEAR and EXIT, code for this accordingly. (5)
Page 5 of 5