CS 1054: Lab 3

Lab meeting 3: A Simple Converter

Note

For this lab you can work with a partner.

Aim

The main aim of this lab is to introduce you to mathematical operators and if statements. This should be a hint that you will be using both :).

List of tasks

For this lab you will implement three simple converters that convert

Formulas

Look them up on the net.

Class Design

Think about the class design and implement the methods properly. Your parameters should accept the number to convert and the type of conversion required. Based on this, it should display the result in a meaningful manner.

Checks

None of the methods should accept negative values. In case a user tries to input one an error message should be displayed. Also, make sure you check for division by zero error in case you have to.

Please document your code.

Absolutely Necessary!


© Mir Farooq Ali 2003.