Certificate IV in Information Technology

South Regional TAFE, Albany Campus, Western Australia


Programming

The programming units we studied in Certificate IV were as follows:

By the end of the course, the object-oriented and procedural programming we had been learning (as C# language) well and truly tied in with the other IT skills we were trained in, namely dynamic web design and SQL. On this page I will only look at the studies we did in our Monday and Tuesday morning's classes, in "Build a user interface" and "Apply introductory programming skills in another language," as we had separate assessments for these two units. This was mainly procedural programming. I shall look more into OOP (and T-SQL, for that matter) on the page to do with Web Design and our projects for that part of the course.

TexCal Petrol Bowser project

The first major assignment we had to do in Programming was called the TexCal Petrol Bowser project. The project was, as I wrote in my design document, tailored to meet the following requirements: "[A] computer program that allows a customer to choose options and enter data on a petrol bowser’s touch screen terminal...

"We need a program that will allow a user to input the following parameters into a program: 1) his or her preferred type of fuel, 2) the amount of fuel desired, and 3) whether he or she wants to pay for a car wash. It must contain labels describing each component of the interface (next to fuel type buttons, car wash options etc.), as well as labels to indicate the chosen fuel type, selected litres of petrol, and whether a car wash was chosen. It must display the total litres of fuel purchased in a label, as well as the total fuel cost and total price (which includes the cost of a car wash)."

Here is the final result of my work in coming up with such a program:

TexCal interface

Assessment 1: TexCal petrol bowser program

Before we were permitted to proceed with the procedural C# programming behind the scenes, we were required to build the user interface and gain approval from the lecturer before continuing. You can find the design document here:

TexCal Design Document [180KB]

The project underwent extensive testing, and as such one of the components of the final submission was for a fellow student to document our alpha, beta and final testing, which you can find here:

TexCal Testing Document [58.4KB]


C# Exercises

So "TexCal" was our first assessment in which we had to build a user interface. Concurrently with this, we we assigned certain exercises, some of which were to prove our mathematical skills, and all of which required us to put into practice what we had learnt during the class exercises the lecturer went through with us in the initial weeks of the semester. Not only did we refresh the C# coding we learnt in Certificate III the semester before, but we also learnt anew the unfamiliar concepts among the following:

This subject matter came under the unit title of "Apply introductory programming skills in another language," and, unlike Cert III and IV students of preceding years who learnt to code with Visual Basic, we were taught to program in C#, which is an object-oriented and event-based language.

We were assigned four programming tasks.

Task 1 was a simple four-fold exercise involving A. Loops and arrays (Iteration), B. The selection construct (Selection), C. Gradation of academic results (Sequence), and D. The LIST data structure (Data Structure).

Task 2 required us to "Create a program that will display the Countries of Europe in a list and the Capitals of the countries in another list. The program should then allow a user to search for the capital of a country and the country a city is the capital of. Also add an option to check if a country exists in the list[...] For the Country search use a 2D ARRAY and for the Capital search use a DICTIONARY and to check if a country is in the list use a BINARYSEARCH on an array."

Country search

Task 2: Countries Search program

Task 3 was a simple temperature converter that converted from Celsius to Fahrenheit and vice versa. It was designed to test our numeracy skills in applying the formula for the conversion.

Task 4 was a paint calculation program, to be created to these specifications: "You are required to create a Paint Program that will ask for the dimensions of a house and calculate the amount of paint that would be required to paint the house. Assume that the house is a perfect rectangle.

"The following is essential for accuracy:

Task 4 was also designed to test our numeracy and programming skills, was probably the hardest of these four exercises. Task 3, the Temperature Converter, was the easiest as it relied on only a few simple formulaic lines of code.


European Luxury Hotels

Our final programming assessment was called "European Luxury Hotels" and in this project we focussed as much on the design aspect of the solution as on its functionality, since it had to be user-friendly and appealing to the eye as well as work flawlessly. The specifications for "European Luxury Hotels" in the project brief were as follows:

"You are to build a stand-alone program that will be installed on a terminal within the Travel Agent so that people entering the travel agencies can walk up to the terminal and have all their inquiries answered by the program. They will then be able to ascertain whether or not they wish to proceed with a booking. This will result in a positive result for the booking agency as well as The European Luxury Hotels.

"The details of each booking are to be stored in a Database called Bookings."

I considered it a good idea to create a Draw.io mockup of what the final product would look like, and the following was approved by my lecturer:

Hotel Select Screen mockup

Assessment 2: European Luxury Hotels (mockup)

Although it was a good idea to do this, my lecturer encouraged me to proceed with the coding as soon as possible and to let the design take shape over the course of the program's creation.

The Visual Studio solution consisted of eight forms, as follows:

The final design for the Select Hotel form was naturally more polished and appealing than my initial mockup.

Hotel Select Screen

Assessment 2: European Luxury Hotels (Select Hotel screen)

Although it was not strictly required for passing the unit, the lecturer mentioned to me that a flow chart would be a good addition to the overall components thereof, and this is what I came up with:

ELH flow chart

European Luxury Hotels flow chart (created with Draw.io)

If you want to look at all the components of this project, you can find the design document here (be warned, it's a fairly large file):

ELH Design Document [12.8MB]

"Build a user interface" and "Apply introductory programming skills in another language" were enjoyable and challenging units in which we worked with industry-standard software, in a professional environment working under a deadline. Here is an example of some code I wrote for the "temperature converter" C# Exercise:




namespace TempConverter
{
public partial class TempConverter : Form
{
public TempConverter()
{
InitializeComponent();
}

private void btnExit_Click(object sender, EventArgs e)
{
Close();
}


private void btnToC_Click(object sender, EventArgs e)
{
// Try to convert input to doubles, perform calculation, and set
// label text to calculated value (Fahrenheit to Celsius)
try
{
// Convert txtValue.Text to Double
Double dblValueF = Convert.ToDouble(txtValue.Text);
// Subtract 32 and multiply by 1.8
Double dblValueC = (((dblValueF - 32) / 1.8));
// Substitute values into labels
lblCelsius.Text = Convert.ToString(string.Format("{0:0.00}", (dblValueF))) + " Fahrenheit =";
lblFahrenheit.Text = Convert.ToString(string.Format("{0:0.00}", (dblValueC))) + " Celcius";
}
catch
{
// Shows an error message and clears text field if input
// is incorrect
MessageBox.Show("Invalid input, please try again", "Error");
txtValue.Text = "";
}
}

private void btnToF_Click(object sender, EventArgs e)
{
// Try to convert input to doubles, perform calculation, and set
// label text to calculated value (Celsius to Fahrenheit)
try
{
// Convert txtValue.Text to Double
Double dblValueC = Convert.ToDouble(txtValue.Text);
// Subtract 32 and multiply by 1.8
Double dblValueF = (((dblValueC * 1.8) + 32));
// Substitute values into labels
lblCelsius.Text = Convert.ToString(string.Format("{0:0.00}", (dblValueC))) + " Celsius =";
lblFahrenheit.Text = Convert.ToString(string.Format("{0:0.00}", (dblValueF))) + " Fahrenheit";
}
catch
{
// Shows an error message and clears text field if input
// is incorrect
MessageBox.Show("Invalid input, please try again", "Error");
txtValue.Text = "";
}

}
}
}

This concludes the programming section of this website, although as I mentioned before, we used the C# programming language extensively in our dynamic Web Design classes. In that case it was much more involved and, unlike these two units, consisted of OOP (object-oriented programming) rather than just procedural programming.



Home