B6IT017 Principles of Programming December 2013
B6IT017 Principles of Programming December 2013
Principles of Programming
Momentum
INSTRUCTIONS TO CANDIDATES:
a) For each of the following kinds of data, define the most suitable and meaningful variable
definition to represent the data in a C# program.
(2 marks)
b) Briefly explain the terms compile, link, syntax error and run-time error.
(4 marks)
(4 marks)
(6 marks)
e) Using examples, explain what the pre and post increment operators do.
(4 marks)
(4 marks)
Section B – Answer One Question From This Section.
The answer to either question must be completed using Visual Studio and
uploaded to Moodle
Question 2 - 35 Marks
Write a C# program which collects all the Players from a football league. The user of the
program should be asked how many Players they wish to record. The user must enter goals
scored for each player.
Question 3 - 35 Marks
Write a foreign exchange C# program which allows a user to convert from Euro to a selected
alternative currency. The user should be first presented with a menu which indicates the options
available to the user.
The user must be able to convert to US Dollars, British Pounds, Australian Dollars and
Canadian Dollars. Once the user selects which exchange rate they wish to use, they must then be
asked for the amount they wish to exchange in euro.
Once the result is presented with the results they should be asked if they would like to quit the
program or return to the main menu.
(35 marks)
Section C – Answer One Question From This Section.
The answer to either question must be completed using Visual Studio and
uploaded to Moodle
Question 4 - 35 Marks
The user enters the temperature in the textbox at the top of the form, selects a button and the
equivalent temperature is displayed in the label at the bottom of the form.
C = 5.0/9.0*( F -32.0)
Examples:
The user enters the amount to be converted in the textbox at the top of the form, selects one of
the buttons and the conversion is displayed in the label at the bottom of the form.
To convert
Miles to Kilometres use the formula: 1.609
Pounds to Kilos use the formula: 0.453
(35 marks)
END OF EXAMINATION