File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Help with Arithmetic Tester. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with Arithmetic Tester." Watch "Help with Arithmetic Tester." New topic
Author

Help with Arithmetic Tester.

Mike Meakin
Ranch Hand

Joined: Dec 30, 2004
Posts: 88
This needs to be done in frames.
Create a simple arithmetic tester to practice students in simple arithmetic. The application should have an entry screen, where the user may login. On succesful login the screens should change to a choice screen where the user will be able to select an arithmetic test(addition, subtraction, multiplication, or division).
when undertaking a test , a running score should be maintained, with a final percentage mark being offerd on completion.
(I'll post my first attempt soon) Any suggestions would be great.
[ June 15, 2005: Message edited by: Mike ]
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Originally posted by Mike:
Any suggestions would be great.


Keep it simple. Write tests as you go. If your tests fail rewrite until they pass. Refactor regularly. Always make sure your code compiles and passes all tests before moving onto the next task. Use a build tool such as ANT or make to automate and control your build process.
Using these tips should make your programming much more productive.
Mike Meakin
Ranch Hand

Joined: Dec 30, 2004
Posts: 88
Ok here the first frame where you simply enter a username and press continue to go to the next frame. So I need some code just so you put your name in 'jTextField1' and press JButton1(continue) to bring you to the next frame. Heres the code so far:

[ June 15, 2005: Message edited by: Mike Meakin ]
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1824

Mike:

I'd say welcome to JavaRanch, but you've been around for a while now, I see. However, perhaps recently you've changed your display name in such a way that it no longer meets the JavaRanch Naming Policy. Please change your display name so that it conforms (we are looking for a first and last name; while we prefer your real name, it does not have to be such). Thanks!


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Right, you broke rule number 1. Keep it simple. you broke rule number 2 your code doesn't compile (but I'll give you the benefit of the doubt and just imagine the import statements in your code and the class and variable declarations). Also please enclose your code in the UBB code tags. There is a button underneath the textarea to help you do this.
My guess is that you created this code in an IDE of some form or other. Why are you using XYLayout this is not part of the JFC libraries. How does this layout manager behave when you resize the frame?
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Here is one of the simplest Swing applications you can write:
Use this template and build on it as you progress through your task list.
Mike Meakin
Ranch Hand

Joined: Dec 30, 2004
Posts: 88
It needs to be like I'm doing it in my code, like this,Imagine frames:

Frame1: Enter Your Name
...............(jLabel1)
Continue (jbutton1)
|
|
Frame2: Welcome To Arithmetic Test
Select A Test
A. Addition (button1)
B. Subtraction (button2)
C. Division (button3)
D. Multiplication (button4)
|
|
|
Frame3: e.g 10 + 10 = (Jlabel for answer)

Submit(jButton1)

I've just started the first frame, its going to be quite a big project for me!
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
A few more tips before you go to far. Read up on the MVC pattern. For this type of question and answer program you may consider putting the questions on JPanels that are contained in a "main frame" that uses the CardLayout. When you get stuck on specific Swing topics use the Swing forum to post your queries.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with Arithmetic Tester.