The code build is "succesful" but nothing happens...

I have a problem with the code, what it is supposed to do is get the grades inputed from the user, calculate an average and then print it. I have one marked error in the code and its the " edp.processStudents();" part. Also, when i run the code nothing happens, it just tell me build successful (using NetBeans). Please help me get the code right< thanks in advance>
import java.text.DecimalFormat;
import javax.swing.JOptionPane;
import javax.swing.*;
import java.util.*;
public class EdronProject {
private int studentCount;
private static final String USAGE = "Usage: java EdronProject <student count>";
private List<Student> list;
public EdronProject(int count) {
studentCount = count;
list = new ArrayList<Student>();
public static void main( String args[] ) throws NumberFormatException {
int count = 0;
switch (args.length) {
case 1: count = Integer.parseInt(args[0]); break;
default: System.out.println(USAGE); System.exit(0);
EdronProject edp = new EdronProject(count);
edp.processStudents();
edp.printStudents();
class Student {
private int total,
gradeCounter,
grade1,
grade2,
grade3,
grade4,
grade5,
counter;
private double average;
private String gradeString,
studentName;
public void setStudentName(String name) {
studentName = name;
public String getStudentName() {
return( studentName );
public void setGrade(int gradeNo, int grade) throws IllegalArgumentException {
switch( gradeNo) {
case 1 : grade1 = grade; break;
case 2 : grade2 = grade; break;
case 3 : grade3 = grade; break;
case 4 : grade4 = grade; break;
case 5 : grade5 = grade; break;
default: throw new IllegalArgumentException("ERROR: Bad grade number passed!");
public int getGrade(int gradeNo) throws IllegalArgumentException {
int grade = 0;
switch( gradeNo) {
case 1 : grade = grade1; break;
case 2 : grade = grade2; break;
case 3 : grade = grade3; break;
case 4 : grade = grade4; break;
case 5 : grade = grade5; break;
default: throw new IllegalArgumentException("ERROR: Bad grade number passed!");
return( grade );
public void processStudents() {
for (int counter = 0; counter < studentCount; counter++) {
Student student = new Student();
student.setStudentName(JOptionPane.showInputDialog("Enter student's name:"));
student.setGrade(1, Integer.parseInt(JOptionPane.showInputDialog( "Enter Student Grade for Psychology ")));
student.setGrade(2, Integer.parseInt(JOptionPane.showInputDialog( "Enter Student Grade for Math ")));
student.setGrade(3, Integer.parseInt(JOptionPane.showInputDialog( "Enter Student Grade for Art ")));
student.setGrade(4, Integer.parseInt(JOptionPane.showInputDialog( "Enter Student Grade for Science ")));
student.setGrade(5, Integer.parseInt(JOptionPane.showInputDialog( "Enter Student Grade for English ")));
list.add(student);
total = grade1 + grade2 + grade3 + grade4 + grade5;// add grade to total
DecimalFormat fmt= new DecimalFormat(".##");
average=total/gradeCounter;// calculate average of all grades entered
System.out.println(average);
public void printStudents() {
for ( int i = 0; i < list.size(); i++ ) {
Student s = list.get(i);
printStudent(s);
private void printStudent(Student student) {
System.out.println("Student Name: "+student.getStudentName()
+", Pych: "+student.getGrade(1)
+", Math: "+student.getGrade(2)
+", Art : "+student.getGrade(3)
+", Sci : "+student.getGrade(4)
+", Eng : "+student.getGrade(5)+"\n");

Java_Learner31 wrote:
ok everyone calm down, it you do not wish to help me its fine, no worries :)I tried to be nice and I helped you in your other posting.
You waste peoples time by not reading replies and posting the same sh*t twice.
Stay with one post per problem and don't expect "teh codez", then you'll be fine. Now go and read my response in your other thread.

Similar Messages

  • HT2240 I have installed quicktime 7 on my max OS X machine, and I have bought QT 7 pro for OS X. I open Qt7 and enter the registration code I got from buying QT 7 pro, the icon changes to pro, but nothing happens and it doesn't appear to upgrade. help

    I have installed quicktime 7 on my max OS X machine, and I have bought QT 7 pro for OS X. I open Qt7 and enter the registration code I got from buying QT 7 pro, the icon changes to pro, but nothing happens and it doesn't appear to upgrade. help

    I have installed quicktime 7 on my max OS X machine, and I have bought QT 7 pro for OS X. I open Qt7 and enter the registration code I got from buying QT 7 pro, the icon changes to pro, but nothing happens and it doesn't appear to upgrade.
    And just what sort of changes in "appearance" did you expect?
    If you can access the editing, conversion, and/or properties options once a file is loaded then the QT 7 app has been upgreaded for "Pro" use.

  • Hello I am trying to download the latest itunes and it keeps asking me to restart the mac and I do but nothing happens. Can someone help? Thankyou

    Hello I am trying to download the latest itunes and it keeps asking me to restart the mac and I do but nothing happens. Can someone help? Thankyou

    Hi Chris, I know where to check for updates but after I agree to terms conditions etc it asks to restart the computer before it can start downloading. I do that and it keeps repeating the process?

  • HT201401 my iPhone 4s  fails to turn on. When I press the sleep button the apple logo shows displays but nothing happens after that

    iphone fails to turn on. The apple logo shows up but nothing happens after that

    Hi Haleynichole_99!
    I have an article here with some troubleshooting steps that can help you resolve this issue with your iOS device:
    iOS: Unable to update or restore
    http://support.apple.com/kb/HT1808
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • HT1926 went to update to the latest iTunes software, download went fine but when completed, I couldnt open iTunes. I uninstalled an reinstalled again and its happening again. I click on the iTunes icon to open but nothing happens? (Im a Windows user)

    After plugging in my iPhone 4s to iTunes it asks me to update my software. I went to update to the latest iTunes software, download went fine but when completed, I couldnt open iTunes. I uninstalled and reinstalled again and its happening again. I click on the iTunes icon to open but nothing happens? (Im a WindowsPC user)

    Restart Computer.
    Refer steps here to delete SC file(s):
    Win7/Vista http://support.apple.com/kb/TS2363
    WinXP http://support.apple.com/kb/TS1776
    Then proceed to repair your QuickTime. START > CONTROL PANEL
    WinXP - Add n Remove Programs
    Win7/Vista - Programs n Features
    highlight QUICKTIME and click CHANGE then REPAIR

  • HT204406 I can't seem to download songs from iTumes Match on my new iPhone 5. It still works fine on my iPad. Both are running ios6 and there is plenty of free space on the phone (20 GB or so). The download icon shows & flashes but nothing happens.

    I am trying to play songs from iTunes Match on my phone everything is enabled. The songs and playlists show up but when I select one it won't download or play. The download status icon next to the song name flashes on and off but nothing happens. When I go to the iTunes Store the download section shows the same behavior - it flashes that there is 1 download continuously but nothing downloads. My iPad on the same network also running ios6 works fine. Any ideas?

    Problem closed (although not resolved).  After working with Apple support, no resolution was found.  I asked for a refund of the iTunes match purchase price, which was granted.  Interestingly the support tech, who was very nice if not particularly helpful from a technical point of view, spun the "resolution" of refunding my iTunes match purchase price as a positive one, here is a quote from the final email
    "I'm glad to hear that you're not having issues with the songs you've purchased.  Nothing makes Apple happier than to hear that our customers concerns have been rectified."
    It is notable that I never had an issue downloading music directly purchased thru the iTunes store, the only issue that existed was downloading songs that I ripped from my CD collection and "matched". 
    I'm happy that I received my money back, however I wish that the iTunes Match service worked for me (I was looking forward to this service).  I'm most upset at the time I wasted trying to fix this problem.
    I'll now download music the old fashioned way: syncing with iTunes directly.

  • HT4356 The ipad2 working fine with AirPrint. Now the print centre says printing but nothing happens. Anyway to fix this ?

    The AirPrint from ipad2 to hp printer was working fine. All of a sudden the function no longer works! The ipad2 recognises the printer and even sends the print command. The printer centre say 'printing' but it remains syptuck in that position and no printing occurs. I've reset the wireless connections and deleted printing queues and reset the printter to original settings. The printer is found but nothing happens! Can anyone help out?

     ccrobin I’m sorry your having this much trouble with this printer . Hopefully this step will fix your problem try a partial reset.
    Ccrobin have you tried to connect a USB cord to the printer directly to the computer to see if it has the same issue?
    {edited for non standard info}

  • My ipad 2 turns black and shows the rotating symbol  for startup but nothing happens what can i do?

    my ipadscreen turned black and just shows a rotating symbol for startup but nothing happens. What can i do?

    iPad: Not responding or does not turn on
    If nothing there helped, time for a restore.
    iTunes: Backing up, updating, and restoring your iPhone, iPad, or iPod touch software

  • How can I print from my ipad2 to my hp6210 all in one using printopia...I can see the list on my ipad2, I select the printer and say print but nothing happens.

    How can I print from my ipad2 to my hp 6210 all in one using printopia? I see my printer on my iPad, I select it and say print and nothing happens. The printer is connected to an older Mac with OS X 10.4.11 but I do have an imac in another room. I have trouble printing from the iMac to this printer also even tho share is on but the printer works fine with the old Mac it's connected to. My iPad has the latest iOS.

    A few things to consider.
    The computer Printopia is loaded on must be powered on and must be able to print on the printer that is being shared.  If the iMac is having problems printing to the printer it could indicate a problem with the share setup.

  • My iPad is recognised by my computer but won't sync properly. Some syncing seems to be going on in the info bar at the top of my computer, but nothing happens on the iPad....I.e. no message that says syncing is taking place. It is an iPad 1

    My iPad doesn't seem to sync properly with my computer (vista home). Although some sort of back-up syncing seems to be happening in the bar at the top of iTunes, no syncing message appears on my iPad. I am trying to sync some music on my computer to my iPad.   The computer recognises my iPad and appears to be doing something but the usual message on the iPad saying that syncing is taking place doesn't appear.

    Hello Demo, thanks for your response.  I am signed in with the same ID and there are no restrictions on whats synced.
    The difference now when I connect is that (a) nothing shows on my iPad, also (b)  ' ' Autoplay' opens up for some reason...this didn't happen before.  Also no tabs open up to give me any choices.  The only thing that happens when I connect is that the little syncing bar at the top is active for about 30 seconds....backing up or syncing and then finishes.
    The main thing which intrigues me is that no message re syncing appears on my iPad. I've searched the help tutorials but nothing seems to quite match my problem, best wishes, Madge

  • I attempted to download the Lightroom 4.3 update but nothing happened

    I just purchased Lightroom 4. After installing I was prompted to download the 4.3 update, but when I clicked on Download, nothing happened. I tried 4 times. I have a Mac Pro running 10.6.8

    SOLVED THIS MYSELF (...sort of, anyway.) I had been using the Firefox browser, which is normally more compatible with downloads, but after reading an old reply to a similar question I tried the Safari browser and it worked first time.

  • How to delete a movie in iDVD in the MOVIES pane. I highlight the movie and push delete, but nothing happens.

    How can I delete a movie in the MOVIES pane in iDVD? I highlight the movie and push delete, but the movie remains in the pane window. Some of the images in the pane are downloads are from QuickTime, and I want theme deleted from the MOVIES pane in iDVD.
    Thank you

    Hi Beverley,
    Best wishes for the 2006 , and happy new year to you !!
    Sorry for this late reply to your suggestion. Here is finally what worked for me :
    I simply moved the second part of my movie (this second part is for my second DVD) to the right pane, including all the transitions etc, that I previously made. Doing this I just kept in timeline the content of my first DVD, and it worked like a charm.
    Afterwards, I did the contrary : took back the second part to the beginning of the time line, and moved the first to the right panel.
    I had tried copy.paste the clip to another project before, but this duplicate the materiel and take a huge space onto the hard drive. Moreover, as you may have noticed, there is no simple way to decrease the size of a project after you have imported the clips. The trash/ empty trash fonction is very conservative and does not make it possible to reduce the size of the altered materiel (I finished with a 45 gig project for a 2 hours movie).
    Luc

  • HT201442 I have changed the hosts, I have added the address and deleted it but nothing happens, I still get the 3194 error

    I don't , please help me with this!
    I tried everything but nothing is working out with me.

    Just on your computer? Have you checked that there isn't IP filering on your router?

  • I click on the plus symble next to a tab, to open a new tab, the plus symble turns blue, but nothing happens. Why?

    I want to open a new tab, I click on the PLUS next to the last tab opened, it turns blue, but does nothing. No new tab is open

    Caused by the Ask Toolbar extension in Firefox 3.6.13+, disable that extension or un-install it.

  • When I try to open Author Search in SCOPUS, it gives me the trying to open symbol, but nothing happens?

    When I open SCOPUS and fill in the "Author Search" subprogram, the symbol indicates searching, but the search is never satisfied. I can access SCOPUS by way of Safari, but my default program is FireFox and I would like to know what the problem is. I have tried clearing the cache, but that doesn't help. I also have some problems with NCBI BLAST when I use FireFox but not when I use Safari.

    Do you know if there is a free way to test this so a volunteer can take a look? If not, you might try submitting a support request after trying the below general advice.
    * Contact: http://help.elsevier.com/app/ask_scopus/p/8150
    When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site.
    (1) Cache - you already did this part
    (2) Remove the site's cookies (save any pending work first). While viewing a page on the site, try either:
    * right-click and choose View Page Info > Security > "View Cookies"
    * Tools menu > Page Info > Security > "View Cookies"
    In the dialog that opens, you can remove the site's cookies individually.
    Then try reloading the page. After logging in again, any improvement?

Maybe you are looking for

  • Problems with parameterized custom tags - urgent

    Hi All, I am not able to retrieve my attribute values in Tag Support Class? it doesn't give any errors while compiling and also the tag works without those attributes. I am able to print some html using the same tag but not able to print the passed a

  • Complete Customising step to implement SAP PP module for New client.

    hi frnds, Can Any body tell me that wht are the intial to final step to be follow(step-by-step) to configure & customise the SAP PP Module for new Client.Suppose industry is Process Industry. I'll be graceful to all who help in this regard. Thanks Pa

  • N97 photo browser crash..

    Hello all, This is my first post here anyway I'll get to the point..The original photo browser that came installed keeps on shutting down on me whenever I zoom into some photos.. not all..and no the photos are not corrupted, does anyone have a soluti

  • .mp4 videos stuttering

    Hello all, I did some searching and found no definitive answer.. I am shooting HD video with a Sanyo Xacti VPC-CS1 in 1080p. When I am done shooting, I upload it to my desktop and try to play it from there. It opens up Quicktime and starts to play bu

  • You need to restart your computer error =(

    Came home one day, Randomly i got the error every time i tried to start up. OS X would not load just give me the grey box saying i need to restart. I ran from my origional cd, Did extensive apple hardware test - Passed Ran repair disk Repair permissi