Please do not use textspeak in Usenet posts.
A couple of points about your assignment that you will need to know if you
ever use Java outside of school:
- by long-standing and nearly rigid convention, Java variables are spelled
without underscores and with mixed case, capitalizing each word part except
the first, hence "percentMarkedUp".
- doubles work fine as currency values for academic work, but not so much in
the real world. The issues are somewhat complex, so we stick with doubles
until we've learned some more of the basics.
Let's review your assignment piece by piece:
I'll give you this part. A "Java program" is a class with a properly-defined
main() method.
package programming.oneohone;
public class RetailModel
{
public void main( String [] args )
{
}
}
There are two places you could declare variables so far, within the class
itself as instance or class variables, or within the main() method. The
main() method is simpler, so start there.
Do you know how to declare variables? I'll give you one, focusing in on just
the main() method and not the rest of the class.
public void main( String [] args )
{
double percent_markedup;
}
It's the same for the others.
Well, the declaration of 1. that I showed you doesn't assign a value, because
it doesn't have an initialization clause.
Yet.
The tutorial gives a hint near the top of the page about initialization, in
case you forget the course information:
<
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/variables.html>
So go ahead and modify the declarations you just wrote and add the
initializations.
Solve one itty-bitty problem at a time, and make sure your program is correct
at each stage. Only then add in the next piece of the puzzle, one itty-bitty
problem at a time.
This is beginning to sound a lot like Patricia Shanahan's advice, isn't it?
You should go back to her link and read it again, very carefully.
Quiz: Where (in what file) do you store the source code for your RetailModel
program?
General advice: Read the rest of the tutorial, not just the one page I linked
you to.