making a class after the program

Hello

I always thougth that you had to make a class before the program. Ive been ask to write the program then do the class.

Ill make this a bogus form that way it will guide me with my assignment. perhaps someone could help.

lets say piggy bank this is just a cheap example

double oldtotal, newtotal, addcoin,minuscoin;

do

print first piggybank

enter total (print total)

enter coins (print addcoin formatcurrency)

print newtotal

enter coins taken (print minuscoin format currency)

print newtotal

print anther piggy bank y/n

while = y

this is what you get when it runs

==============

total = $num

coinadded = $num

newtotal = $

minuscoin =$num

newtotal = $num

================

how do I go from this program and then create a class

just showing the new total

showing what the old total was

then determine if the new total is more or less than the old total.

anyone lend some guidence thank you very much.

how will I know if the class is right.

Im also confused if after both are written will one import the other.

thanks again

Rewind

[1242 byte] By [r3wind] at [2007-9-26 10:13:45]
# 1

Well, if you can actually make a program without first making a class, I'll give you the nobel prize. Did someone also ask you to create cold fusion?

You don't seem to know the difference between a class and a program. A compiled class is (often) a program, so if you "do the class" you're writing a program. So your request is impossible.

Kayaman at 2007-7-1 22:14:55 > top of Java-index,Archived Forums,Java Programming...