Tuesday, April 29, 2008

Using three IDEs (and Notepad) to create Java programs.

Using simply notepad (and without looking on the Internet) create a program that will keep track of a car's mileage, mph, gas in the tank, and the known sum spent on gas. You will create methods to simulate driving a certain distance. The program must calculate the miles driven and the gas left in the tank. The same method should also allow for the user to enter in the price of gas, which will be kept in a variable.

Download this. Open it with BlueJ.

Create a class to keep track of zoo animals. Use Netbeans to enter in their information. Store the info in an ArrayList when a button is clicked.

Lastly using Eclipse, write a program that teaches arithmetic to your younger brother. The program tests addition and subtraction. In level 1 it tests only addition of numbers less than 10 whose sum is less than 10. In level 2 it tests addition of arbitrary one-digit numbers. In level 3 it tests subtraction of one-digit numbers with a non-negative difference. Generate random problems and get the player input. The player gets up to two tries per problem. Advance from one level to the next when the player has achieved a score of five points.


Use the following class as your main class:
/**
This program runs the math game.
*/
public class MathGameRunner
{
public static void main(String[] args)
{
MathGame game = new MathGame();
game.play();
}
}

No comments: