Tuesday, May 15, 2007
assignment 4 - Telephone number word generator - file stream code
///////////////////////////////////////////////////////////////////////////////////
// telephone-number word Generator
// coded by: philip hariyanto
//
// this program is a GUI program that, given a seven-digit number, and it will generate
// every possibe seven-letter word combination corresponding to that number. there will be
// 2,187 such combinations.
// Classes: 1. Form1.cs: to handle all GUI element and input validation ( input must have 7 numbers, must be all numbers, must not be 0 and 1)
// 2. Generator.cs: to handle all the algorithm to generate and write them to file
//
//
//////////////////////////////////////////////////////////////////////////////////
download code here:
assignment4.zip
download executable file here:
assignment4.exe
assignment 3 - Converter Fahrenheit to Celcius GUI program
///////////////////////////////////////////////////////////////////////////////////
// Converter Fahrenheit to Celcius program
// coded by: philip hariyanto
//
// this program using program that converts from Fahrenheit to Celsius.
// The Fahrenheit temperature should be entered from the keyboard (via a TextBox).
// A Label should be used to display the converted temperature.
// Use the following formula for the conversion:
// Celsius = ( 5 / 9 ) x ( Fahrenheit - 32 )
//additional feature: display 12 conversion history and format error handling
//////////////////////////////////////////////////////////////////////////////////
download code here:
assignment3.zip
download executable file here:
assignment3.exe
assignment 2 - error handling
this program have 2 classes:
- Class1: main class.this class will create an object by calling a constructor from CDivided class
- CDivided: this class has a default constructor and another constructor with 2 arguements
there are 3 privates variable: a as a nominator and b as a denominator, and result of a/b
this constructor from CDivided will pass information about constructor failure
download the code here:
assignment2.zip
- Class1: main class.this class will create an object by calling a constructor from CDivided class
- CDivided: this class has a default constructor and another constructor with 2 arguements
there are 3 privates variable: a as a nominator and b as a denominator, and result of a/b
this constructor from CDivided will pass information about constructor failure
download the code here:
assignment2.zip
assignment 1 - Employee hierarchy test application - polymorphism
// PayrollSystemTest.cs
// Employee hierarchy test application.
// this test will create each type of employees to the system
// declare an employee matrix with size of 4
// assign each element to one of the employee and
// generically process each element in array employees ( polymorphism )
the program will process using polymorphism technic by creating an array of their base class,
and assign each element to the specific object.
methodology:
I added 2 private variable in Employee class to store date class information about each employee's birthday and hire date
- private Date birthDate;
- private Date hireDate;
and 1 protected decimal bonus. I am using protected variable in order to let derived classes use bonus variable to add bonus to the earning.
thus, the constructor of base class employee need to add 2 more arguement
by adding dateOfBirth and dateOfHire varialbes of Date type to function declaration.
This also influences derieved class constructors that used base class constructor which their constructor needs to add
": base( first, last, ssn, dateOfBirth, dateOfHire )"
adding bonus feature:
because we need to check if an employee birthday month,
we need to create a public assessor of private Date birthDate. The bonus will be added if there is a match and
this feature will be handled in earning method in each type of employees.
advantance test program:
this program is using PayrollManager class to manage adding, display monthly report, and list of employees. Some employees
from PayrollSystemTest.cs is initialize in the class constructor.
because this is a mini program. this program will not tolarate some invalid input, such as: inputing empty character in menu.
Please follow format example if it is available.
download sample code here:
assignment1.zip
// Employee hierarchy test application.
// this test will create each type of employees to the system
// declare an employee matrix with size of 4
// assign each element to one of the employee and
// generically process each element in array employees ( polymorphism )
the program will process using polymorphism technic by creating an array of their base class,
and assign each element to the specific object.
methodology:
I added 2 private variable in Employee class to store date class information about each employee's birthday and hire date
- private Date birthDate;
- private Date hireDate;
and 1 protected decimal bonus. I am using protected variable in order to let derived classes use bonus variable to add bonus to the earning.
thus, the constructor of base class employee need to add 2 more arguement
by adding dateOfBirth and dateOfHire varialbes of Date type to function declaration.
This also influences derieved class constructors that used base class constructor which their constructor needs to add
": base( first, last, ssn, dateOfBirth, dateOfHire )"
adding bonus feature:
because we need to check if an employee birthday month,
we need to create a public assessor of private Date birthDate. The bonus will be added if there is a match and
this feature will be handled in earning method in each type of employees.
advantance test program:
this program is using PayrollManager class to manage adding, display monthly report, and list of employees. Some employees
from PayrollSystemTest.cs is initialize in the class constructor.
because this is a mini program. this program will not tolarate some invalid input, such as: inputing empty character in menu.
Please follow format example if it is available.
download sample code here:
assignment1.zip
Subscribe to:
Posts (Atom)