Radford University ITEC

ITEC120

lab01:
Making Objects with BlueJ

Today we will learn how to enter the pieArea function we've been using in class, using BlueJ. BlueJ is an “Integrated Development Environment” for Java -- a fancy way of saying, a program which lets you write your own Java programs. BlueJ is installed in the Davis Hall labs (1st and 2nd floors), and the basement of Stuart Hall, although not other labs. If you want to download and run BlueJ on your own computer (it's free!), it is an easy install from BlueJ.org.

To evaluate expressions written in Java:

After having done this, take a few moments to explore BlueJ -- look at the menus, right-click on various items and look at all the choices, etc..

If you have time for more…

For Aug.25 (Fri)

Today we'll write a new function, from scratch. Choose a partner -- today's work will be in groups of two. Before leaving lab, you and your partner must get your assignment checked off, as described below.

The problem: VA sales tax is 5%. Let's write a program which, given an amount, can calculate the amount of tax on an item.

(This list of instructions is a version of the design recipe.)

Now, write a second function (inside class TaxMan), named priceAfterTax(...). Follow the same steps as you did above.

With your partner, discuss: Does your program follow the laws of programming? If you have magic numbers or repeated code, go back and fix that!

To Check Off, before leaving lab: Have the instructor (or peer instructor) come around and verify that you and your partner have class TaxMan which includes:

As always, be sure to log yourself off the computer before leaving the lab.

After lab finishes, compare your solution to this solution.


18You are free to choose a name which doesn't imply it's a job only fit for men.      back


Ian's home page Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu Last modified 2006.Aug.31 (Thu)