View Single Post
  #1 (permalink)  
Old 03-17-2008, 05:47 AM
dc2acgsr99's Avatar
dc2acgsr99 dc2acgsr99 is offline
Member
 
Join Date: Jan 2008
Location: Pittsburgh
Posts: 26
dc2acgsr99 is on a distinguished road
Send a message via AIM to dc2acgsr99
I need some help please.
Heres whats going on, I need a program for class that...

1. asks for number of students.
2. give an input box for their name.
3. give an input box for student score.
4. repeat steps 3 and 4 as many times as inputed in step 1.
5. show the students scores in highest to lowest order with the average.
6. must check for errors.
7. if a number is put where a letter should be or vise versa it must be caught until user quits or enters right response.

now here is where I stand and I will be standing for a long time because I just don't know how to get all that to work. He said something about "arrays" but did not say much about them. I am lost and need much o help here

Code:
import javax.swing.*; public class kthLab3 { public static void main(String [] args) { progra(); System.exit(0); } public static void progra() { intro(); numberOf(); } public static void intro() { JOptionPane.showMessageDialog(null, "This program will take a given number of students and show you the user their scores from highest to lowest with the class average."); } public static void numberOf() { String response; response = JOptionPane.showInputDialog("Enter number of students."); if (response == null){JOptionPane.showMessageDialog(null, "You have chose to quit using the program."); System.exit (0);} else {response = JOptionPane.showInputDialog ("Please enter a number.");} response = JOptionPane.showInputDialog("What is the students name?");
__________________
Hey I'm still learning... Thats my story and I'm sticking to it
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
Sponsored Links