What's new

Java Programming - Can anyone help me?

I know it sounds dumb, but how do i do the second class. This is what i put:

Code:
import java.util.*;
import java.lang.*;
// blah
public class TwoDice
{
int dieOne = 0;
int dieTwo = 0;
int dieThree = 0;
int dieFour = 0;
int dieFive = 0;
int dieSix = 0;

Die dieRoll = new Die();
Die dieRoll2 = new Die();


dieRoll.dieValue()
dieRoll2.dieValue()
}
It gives me an error message on the last 2 lines asking for an identifier in those parenthesis, but i dont know what to put.

damnit, one day this java stuff will stick :(

thanks for all your help, scheisse.
 
1 - part 2) Create TwoDice class. Instantiate 2 objects of the Die class. Display the values of the 2 dice.

Code:
public class TwoDice
{
public static void main(String[] args);
int dieOne;
int dieTwo;
int dieResult;
Die dieRoll = new Die();
Die dieRoll2 = new Die();
^^^ isnt that basically what its asking, just without the display Lines? right here:
Code:
Die dieRoll = new Die();
Die dieRoll2 = new Die();
the objects have beeen created and are calling the random number from the Die class.

Now its just time to display the results (displayLine) am i wrong?????
 
Scheisse, if the following isnt right for both classes, then i give up. Add em into your compiler and see for yourself:

Die Class:

Code:
import java.util.*;
import java.lang.*;
// This class generates a random number
public class Die
{
int dieValue;
public int Die()
{
dieValue = ((int) (Math.random() * 100) % 6 + 
1);

return dieValue;
}
public void displayLine()
{
System.out.print("\n");
System.out.print("Roll One: " + dieValue + "\n"); 
System.out.print("Roll Two: " + dieValue + "\n");             
} 
}
TwoDice Class:

Code:
import java.util.*;
import java.lang.*;
// This class instantiates 2 objects from the Die class
public class TwoDice
{
public static void main(String[] args)
{
Die dieRoll = new Die();
Die dieRoll2 = new Die();
dieRoll.Die();
dieRoll2.Die();
		
dieRoll.displayLine();
dieRoll2.displayLine();
}
}
 
Good shit, man. Hey, give me credit. I somehow figured this out on my own. Took me 3 hours, but it worked.

Ill get back to you in a little bit. I need to thank your posts too.

Anyway, thanks again.
 
Scheisse, before we get off topic, can we just finish this assignment real quick?

Now that we have the second part down, what would you suggest to do for the 3rd? Same shit? Just 5 rolls? Like:

dieOne
dieOne1
dieTwo
dieTwo1
...
up to dieFive1? then just repeat the code? Its just a litte confusing to me to understand because it says its player 1 vs cpu. 5 rolls each, but the professor even states that you can use 5 objects instead of 10.

really, man., can you help me on this one? would be much appreciated. im sick in bed atm.

EDIT - your comment back on second class. my bad. i patched that up after i posted it here. but good looking out on that mistake by me.
 
I went ahead and tried it out myself last night just so i could compare my results to yours.... They werent the same. Yours is right. Mine is wrong... I dont know why i have such a mental block when it comes to this stuff..... You can take a look at mine if you want to:

Code:
import java.util.*;
import java.lang.*;
// This class instantiates 10 objects from the Die class
public class FiveDice
{
	public static void main(String[] args)
	{
		Die dieOnePlayer = new Die();
		Die dieOneCPU = new Die();
		Die dieTwoPlayer = new Die();
		Die dieTwoCPU = new Die();
		Die dieThreePlayer = new Die();
		Die dieThreeCPU = new Die();
		Die dieFourPlayer = new Die();
		Die dieFourCPU = new Die();
		Die dieFivePlayer = new Die();
		Die dieFiveCPU = new Die();
		
		dieOnePlayer.Die();
		dieOneCPU.Die();
		dieTwoPlayer.Die();
		dieTwoCPU.Die();
		dieThreePlayer.Die();
		dieThreeCPU.Die();
		dieFourPlayer.Die();
		dieFourCPU.Die();
		dieFivePlayer.Die();
		dieFiveCPU.Die();
		
		dieOnePlayer.displayLine();
		dieOneCPU.displayLine();
		dieTwoPlayer.displayLine();
		dieTwoCPU.displayLine();
		dieThreePlayer.displayLine();
		dieThreeCPU.displayLine();
		dieFourPlayer.displayLine();
		dieFourCPU.displayLine();
		dieFivePlayer.displayLine();
		dieFiveCPU.displayLine();
		System.out.print("CPU wins 3 to 2");
	}
}
Thanks again for all your help.

Last thing i have to ask you. Is what is this teacher talking about here?

Code:
public class FixDebugFour4
// This class discounts prices by 10%
{
  public static void main(String args[])
  {
	double price = 100.00;
	double rate = 0.10;
	double discount = price * rate;
	double newprice = price - discount;
	System.out.print("Ten percent off of " + price + " dollars "
	 + "is " + discount + " dollars " + "\n");
	System.out.print("The new price of it is " + newprice + " dollars ");
  }
}
She says:
"FixDebugFour4 -- check the words you are displaying and the values. Are you displaying the correct information?"

What is she talking about? Here was the original code we had to correct:

Code:
public class FixDebugFour4
// This class discounts prices by 10%
{
  public static void main(String args[])
  {
	int price = 100;
	double price2 = 100.00;
	tenPercentOff(price);
	tenPercentOff(price2);
  }
  public static void tenPercentOff(int p)
  {
	double newPrice = price * .90;
	System.out.println("Ten percent off";
	System.out.println("New price is " + nwPrice);
  }
  public static void tenPercntOff(double price)
  {
	double price = p * .90;
	System.out.println("Ten percent off");
	System.out.println("New price is " + newPrice);
  }
}
very confused ;(
 
Good shit.

I added the full question to the end of my last post. Here it is again:

Code:
public class FixDebugFour4
// This class discounts prices by 10%
{
  public static void main(String args[])
  {
	int price = 100;
	double price2 = 100.00;
	tenPercentOff(price);
	tenPercentOff(price2);
  }
  public static void tenPercentOff(int p)
  {
	double newPrice = price * .90;
	System.out.println("Ten percent off";
	System.out.println("New price is " + nwPrice);
  }
  public static void tenPercntOff(double price)
  {
	double price = p * .90;
	System.out.println("Ten percent off");
	System.out.println("New price is " + newPrice);
  }
}
 
then she's a dumbass.

honestly, her whole message back to me that day was pretty fucked up. when i asked her for help on the Dice, this is what she said:

"Lab 4-2, Some ideas: You have 3 parts to completein #1 & #2. Do exactly what each section says to do. "

yea... wow that was a lot of help.. took her a week to write back with that??? it seems she does this every other week. one week she'll help you, next week she wont.

Scheisse, ive said it many times, but you are all i really got. i hope you can continue to help me. im not thrilled about this class to begin with, you know that.

She may have been generally analyzing the original code rather then even looking at mine. Basically her trying to say "im not going to tell you whats right and whats wrong." Again, that doesnt help....

I appreciate all youre doing for me, man. Thanks a lot.
 
She gave me shit about not adding comments to the early versions. Wow, big deal. Its not the finished assignment. But she said she wouldnt look at anymore of my work if it didnt have comments to it already because its "unprofessional". yea, sorry lady, Im not exactly a pro at coding. Btw, cant write comments for shit i dont know yet either.

Perhaps thats why she was being a dick. She sent me that email a few days ago. I already responded and said that i was trying my best and im sorry if she feels that im doing poorly. I re-sent my work and even mentioned how i added a comment in it (which you saw: "this class instantiates 2 objects of the die class") and she never wrote back.

She's never been really clear to me, thats why a year ago i couldnt even respond to your PM about this stuff... Shes also my advisor.. Yes it is an online class, and my other professor, who ive had before also screwed up my classes for this semester ( i think i mentioned it in this thread already ) and signed me up for the wrong class ( a class i took with him already.... ) which left me having to take this bullshit online course.

The next assignment is team based and due at the end month, so hopefully it wont be too bad.

All i can say is, again, i should have made this thread sooner. The amount of time i spent going through all this on my own basically was nuts. Like you said in your posts about it being like finding shit in a game. Thank god for all the years i put myself through doing that for MK, or else i probably would of never figured it out.
 
The assignment wound up being wrong. It didnt ask for a displayLine in it and was missing an accessor method. the constructor (math.random) is also not supposed to have a return statement. I do believe i made the corrections to it, but we'll see what happens.

I will post the final results when i find out the grade.

Scheisse - I found out from a few kids at school that this professor stuffs this shit down your throat and they all had to drop her class because it was too hard. Go figure.
 
running through the next debugs. the whole chapter is about using if statements. Im only up to the first one still, having a bit of trouble with the bill part of it, here just take a look at both (original and my version)

Original Version:
Code:
// DebugFive1
// Adds your lunch bill
// Burger and hot dog are $2.59
// Grilled cheese and fish are $1.99
// Fries are 89 cents
import javax.swing.*;
public class DebugFive1
{
  public static void main(String args[]) throws Exception
  {
	String usersChoiceString;
        int usersChoice;
        double bill;
	usersChoiceString = JOptionPane.showInputDialog(null,
              "Order please\n1 - Burger\n2 - Hotdog" +
              "\n3 - Grilled cheese\n4 - Fish sandwich");
	usersChoice= Integer.parseInt(usersChoiceString);
	if(usersChoice = 1 ||  2)
	  bill +=2.59;
        else
          bill += 1.99;
        usersChoiceString = JOptionPane.showInputDialog(null,
          "Fries with that?\n1 - Yes\n2 - No);
        usersChoice = usersChoiceString;
        if (usersChoice = 1)
            bill+=.89;
       JOptionPane.showMessageDialog(null,"Bill is " + bill);
       System.exit();
  }
}



My Version:
Code:
// DebugFive1
// Adds your lunch bill
// Burger and hot dog are $2.59
// Grilled cheese and fish are $1.99
// Fries are 89 cents
import javax.swing.JOptionPane;
public class FixDebugFive1
{
  public static void main(String args[])
  {
	String usersChoiceString;
	double burger = 2.99;
	double hotdog = 2.99;
	double grilledcheese = 1.99;
	double fish = 1.99;
	double fries = .89;
   double usersChoice;
	double bill =
	usersChoiceString = JOptionPane.showInputDialog(null,
              "Order please\n1 - Burger\n2 - Hotdog" +
              "\n3 - Grilled cheese\n4 - Fish sandwich");
	usersChoice = Double.parseDouble(usersChoiceString);
	if(usersChoice == 1 && usersChoice == 2)
	  JOptionPane.showMessageDialog(null, bill += 2.59);
        else
          JOptionPane.showMessageDialog(null, bill += 1.99);
   usersChoiceString = JOptionPane.showInputDialog(null, 
	"Fries with that? \n1 - Yes \n2 - No");
        		if (usersChoice == 1)
            JOptionPane.showMessageDialog(null, bill += .89);
       		JOptionPane.showMessageDialog(null,"Bill is " + bill);
				System.exit(0);
  }
}
 
Yes, Scheiss, it is just how the board is displaying it for some reason. I do try to clean it up after i post here sometimes. I did not think i needed to at this point. I just fixed up these a bit for you. Thanks for letting me know.

Moving on to the other Debugs:

Debug2 Original Code:

Code:
// DebugFive2.java
// Prints odd numbers
// Prints new line after every 10
public class DebugFive2
{
   public static void main(String args[])
   {
     int num, count;
     for(num = 1; num <= 100; num++)
     {
       System.out.print("  " + num);
       ++count;
       if(count = 10)
        {
         count = 10;
         System.out.println();
        }
     }
     System.out.println(End of odd numbers");
  }

}

Debug2 My Code

Code:
// DebugFive2.java
// Prints odd numbers
// Prints new line after every 10
public class DebugFive2
{
   public static void main(String args[])
   {
     int num; 
     int count;
     for(num = 1; num <= 100; num++)
     if(num == 10)
     {
     num = 10;
     System.out.println("The odd numbers are" + num);
     }
   }
}

^^^^ I got the code to run, but im unsure as to what the other display lines are for in the original code.



_____


Debug3 Original Code:

Code:
// DebugFive3.java
// Determines whether item number on order is valid
// Over 999 invalid
// Less than 111 Invalid
// Valid and less than 500 - Automotive Department
// Valid and 500 or higher Housewares Department
import javax.swing.*;
public class DebugFive3
{
   public static void main (String args[])
   {
      int item;
      String itemString, output;
      itemSting = JOptionPane.showInputDialog(null,
         "Please enter item number
      item = Integer.parseInt(itemString);
      if(item < 111)
         output = "Item number too low";
      else
        output = "Item number too high";
        else
          if(item < 500)
               output = "Valid - in Automotive Department";
          else
               output = "Valid - Item in Housewares Department";
       JOptionPane.showMessageDialog(output);
       System.exit(0);
   }
}



Debug3 My Code:

Code:
// DebugFive3.java
// Determines whether item number on order is valid
// Over 999 invalid
// Less than 111 Invalid
// Valid and less than 500 - Automotive Department
// Valid and 500 or higher Housewares Department
import javax.swing.JOptionPane;
public class DebugFive3
{
   public static void main (String[] args)
   {
      String itemString, output;
      int item;
      itemString = JOptionPane.showInputDialog(null,
      "Please enter item number");
      item = Integer.parseInt(itemString);
      if(item < 111)
      item = JOptionPane.showMessageDialog(null, "Item number too low");
      else
      output = JOptionPane.showMessageDialog(null, "Valid - in Automotive Department");
        
      if(item > 500)
      output = JOptionPane.showMessageDialog(null, "Item number too high");
      else
      output = "Valid - Item in Housewares Department";
      System.exit(0);
   }
}
^^ struggling a bit with this one, not even sure where to go after running the compiler for it. I know its missing the "over 999" statement as well. Any would be appreciated.


There is one more Debug to go through after this that i am completly lost on. Hopefully after these 2 i will get it on my own.

Thanks for all your help, Scheiss
 
I looked at some tutorials for JOptionPane since thats where the compiler was having problems on DebugFive3, and i reworked it into this code:

Debug3

Code:
// DebugFive3.java
// Determines whether item number on order is valid
// Over 999 invalid
// Less than 111 Invalid
// Valid and less than 500 - Automotive Department
// Valid and 500 or higher Housewares Department
import javax.swing.JOptionPane;
public class DebugFive3
{
   public static void main (String[] args)
   {
      String itemString, output;
      int item;
      itemString = JOptionPane.showInputDialog(null,
      "Please enter item number");
      item = Integer.parseInt(itemString);
      if(item < 111)
      JOptionPane.showMessageDialog(null, "Item number too low");
      else
      JOptionPane.showMessageDialog(null, "Valid - in Automotive Department");
        
      if(item > 500)
      JOptionPane.showMessageDialog(null, "Item number too high");
      else
      output = "Valid - Item in Housewares Department";
      System.exit(0);
   }
}
Its still missing the 999 etc, but i think all i have to do is add another part to the if statements for that. Tell me what you think. I'll keep working on it,
 
Hey dude, thanks for getting back to me so soon. I was actually just looking at debug2 and saying the same thing to myself. I think its just there to throw you off. Its printing every number 1 to 100 (thats why im posting here right now with my new code). From that point im not sure what else to do, but ill take a look at your code now to see if i can get it. I guess all there is to do is make the if statement say "If its 10 numbers, then print a new line." Im just not quite sure how to do it.

Code:
// DebugFive2.java
// Prints odd numbers
// Prints new line after every 10
public class DebugFive2
{
   public static void main(String args[])
   {
     int num, count;
      {
       for(num = 1; num <= 100; ++num)
       System.out.print(" " + num);
      }
       if(num == 10)
      {
       count = 10;
       System.out.println();
       System.out.println("End of odd numbers");
      }
   }

}

EDIT - Just looked over your code. You're probably right on it. Theres just nothing that complex in the chapter about it, so i dont know how difficult she was trying to be.
 
I just ran your code for debug2, and what you gave me seems right. The output was:

"Odd: 1
Odd: 3
Odd: 5
Odd: 7
Odd: 9
Factor of Ten: 10
Odd: 11
Odd: 13
Odd: 15
Odd: 17
Odd: 19
Factor of Ten: 20
Odd: 21
Odd: 23
Odd: 25
Odd: 27
Odd: 29"

etc...

It looks good to me, i was just wondering, say for my output, when it would list "1, 2, 3, 4, 5, 6, 7, 8, 9, 10-19, etc" in order, to make it skip a line like you already did here after Odd 9. So its basically done already. Im looking over your notes now for debug3.

EDIT - debug3 looks done as well. damn dude, thank you for helping me so fast on these ones. Im going to look it over some more before i move on to debug4. Thanks again, man.
 
Scheiss, i figured that while you're here that i might as well post the final debug:

Code:
// DebugFive4.java
// Outputs highest of four numbers
import javax.swing.*;
public class DebugFive4
{
   public static void main (String args[]) 
   {

    int one, two, three, four;
    String str;
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    one = Integer.parseInt(str);
    str = JOptionPane.showInptDialog(null,"Enter an integer");
    two = Integer.parseInt(str);
    str = JOptionPne.showInputDialog(null,"Enter an integer");
    three = Ineger.parseInt(str);
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    four = Integer.parseInt(str);
    if(one > two || one > three || one > four)
       output = "Highest is " + one;
    else
       if(two > one || two > three || two > four)
          output = "Highest is " + two;
       else
         if(three > one || three > two || three > four)
            output = Highest is " + three;
         else
            output = "Highest is  + four;
    JOptionPane.showMessageDialog(null, output);
    System.exit(0);
  }
}
i havent done anything to it yet, but if you want to take a look at it before i do, then go right ahead.
 
Heres what i did so far:

Code:
// DebugFive4.java
// Outputs highest of four numbers
import javax.swing.*;
public class DebugFive4
{
   public static void main (String args[]) 
   {

    int one, two, three, four;
    String str, output;
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    one = Integer.parseInt(str);
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    two = Integer.parseInt(str);
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    three = Integer.parseInt(str);
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    four = Integer.parseInt(str);
    if(one > two || one > three || one > four)
       output = "Highest is " + one;
    else
       if(two > one || two > three || two > four)
          output = "Highest is " + two;
       else
         if(three > one || three > two || three > four)
            output = "Highest is " + three;
         else
            output = "Highest is  " + four;
    JOptionPane.showMessageDialog(null, output);
    System.exit(0);
  }
}
getting output as "Highest is 20." So i need to change a few symbols i guess and look over that bottom code. Feel free to chime in.
 
I dont think you need to look at it for more then 2 minutes to see it is done already. I dont need it soon.

Code:
// DebugFive4.java
// Outputs highest of four numbers
import javax.swing.*;
public class DebugFive4
{
   public static void main (String args[]) 
   {

    int one, two, three, four;
    String str, output;
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    one = Integer.parseInt(str);
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    two = Integer.parseInt(str);
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    three = Integer.parseInt(str);
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    four = Integer.parseInt(str);
    if(one > two || one > three || one > four)
       output = "Highest is " + one;
    else
       if(two < one || two > three || two > four)
          output = "Highest is " + two;
       else
         if(three < one || three < two || three > four)
            output = "Highest is " + three;
         else
            output = "Highest is  " + four;
    JOptionPane.showMessageDialog(null, output);
    System.exit(0);
  }
}
I changed the symbols so that the output would say "Highest is 4". Thats all. I believe it is done already.
 
Bill was initialized as a double and a String based on user input, so I assigned it to 0;

Something to note (my own practices):
Other than that just try to keep the if statements better organized or they can get out of hand. I use a lot of "{"s when I use ifs and only recently started using single line commands after the requirements of the if are fulfilled.

It's just easier, cleaner, and someone working with you can clearly see what is supposed to be within the if statement.
EDIT: Could just be the code tag on the boards making it look that way though.

Code:
// DebugFive1
// Adds your lunch bill
// Burger and hot dog are $2.59
// Grilled cheese and fish are $1.99
// Fries are 89 cents
import javax.swing.JOptionPane;
public class FixDebugFive1
{
  public static void main(String args[])
  {
	String usersChoiceString;
	double burger = 2.99;
	double hotdog = 2.99;
	double grilledcheese = 1.99;
	double fish = 1.99;
	double fries = .89;
        double usersChoice;
	double bill = 0;
	usersChoiceString = JOptionPane.showInputDialog(null,
              "Order please\n1 - Burger\n2 - Hotdog" +
              "\n3 - Grilled cheese\n4 - Fish sandwich");
	usersChoice = Double.parseDouble(usersChoiceString);
	
	if(usersChoice == 1 && usersChoice == 2)
	  JOptionPane.showMessageDialog(null, bill += 2.59);
   else
     JOptionPane.showMessageDialog(null, bill += 1.99);
   usersChoiceString = JOptionPane.showInputDialog(null, 
	"Fries with that? \n1 - Yes \n2 - No");
	
	if (usersChoice == 1)
   JOptionPane.showMessageDialog(null, bill += .89);
	JOptionPane.showMessageDialog(null,"Bill is " + bill);
	System.exit(0);
  }
}
I looked this over some more and noticed the userChoiceString isnt outputting the 1 and 2 = 2.99 part. How do you fix this?
 
This works:

Code:
// FixDebugFive1.java
// Jason Sodano
// October 30th, 2010

import javax.swing.JOptionPane;
public class FixDebugFive1
{
  public static void main(String args[])
  {
	String usersChoiceString;
	double burger = 2.59;
	double hotdog = 2.59;
	double grilledcheese = 1.99;
	double fish = 1.99;
	double fries = 0.89;
        double usersChoice;
	double bill = 0;
	
	//Asks user for main order
	usersChoiceString = JOptionPane.showInputDialog(null,
        "Order please" + "\n1 - Burger " + 
	"\n2 - Hotdog " + "\n3 - Grilled cheese " 
	+ "\n4 - Fish sandwich ");
	usersChoice= Integer.parseInt(usersChoiceString);
	
	// Burger and hot dog are $2.59
	if(usersChoice == 1 || usersChoice == 2)
	  JOptionPane.showMessageDialog(null, bill += 2.59);
	
	// Grilled cheese and fish are $1.99  
	else
        JOptionPane.showMessageDialog(null, bill += 1.99);
   
	// Asks user for fries
        usersChoiceString = JOptionPane.showInputDialog(null, 
	"Fries with that? \n1 - Yes \n2 - No");
	usersChoice= Integer.parseInt(usersChoiceString);
	
	// Fries are 89 cents
	if (usersChoice == 1)
        JOptionPane.showMessageDialog(null, bill += 0.89);
	
	// Adds your lunch bill
	JOptionPane.showMessageDialog(null,"Bill is " + bill);
	System.exit(0);
  }
}
I didnt do much change to your code, just changed the "&&" to "||" and doobleparse to INTparse. i added a second intparse at the end as well.

Just like you did before with the double
usersChoice = Double.parseDouble(usersChoiceString);

only with an integer

userChoice = Integer.parseInt(userChoiceString);

I'm not sure if that is how it you parse an int in Java or not, looks right though.
i dont even think changing it from dooble to int mattered.
 
Hey Scheiss, i had to correct each of them a little bit, but i cannot figure out how to simplify the conditions in this one:

Code:
// FixDebugFive4.java
// Jason Sodano
// October 30th, 2010
import javax.swing.*;
public class FixDebugFive4
{
   public static void main (String args[]) 
   {

    int one, two, three, four;
    String str, output;
	 // Inputs the numbers in order to determine the highest number.
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    one = Integer.parseInt(str);
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    two = Integer.parseInt(str);
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    three = Integer.parseInt(str);
    str = JOptionPane.showInputDialog(null,"Enter an integer");
    four = Integer.parseInt(str);
	 
	 // Determines which is the highest number.
    if(one > two || one > three || one > four)
       output = "Highest is " + one;
    else if(two < one || two > three || two > four)
          output = "Highest is " + two;
       else if(three < one || three < two || three > four)
            output = "Highest is " + three;
         else
            output = "Highest is  " + four;
				
	 // Outputs highest of four numbers			
    JOptionPane.showMessageDialog(null, output);
    System.exit(0);
  }
}
Her notes were:

"Debug 4:
Use the process of elimination to simplify the conditions. (We are really using set theory.) If one is highest, don't we already know in the else clasue that two is less than one?"
 
Here is what i did:

Code:
// FixDebugFive4.java
// Jason Sodano
// October 30th, 2010
import javax.swing.*;
public class FixDebugFive4
{
   public static void main (String args[]) 
   {
    	int one, two, three, four;
    	String str, output;
	 	// Inputs the numbers in order to determine the highest number.
    	str = JOptionPane.showInputDialog(null,"Enter an integer");
    	one = Integer.parseInt(str);
    	str = JOptionPane.showInputDialog(null,"Enter an integer");
    	two = Integer.parseInt(str);
    	str = JOptionPane.showInputDialog(null,"Enter an integer");
    	three = Integer.parseInt(str);
    	str = JOptionPane.showInputDialog(null,"Enter an integer");
    	four = Integer.parseInt(str);
	 
	 	// Determines which is the highest number.
    	if(one < two)
       output = "Highest is " + one;
    	else
       output = "Highest is " + two;
    	if(!(three < four))
       output = "Highest is " + three;
    	else 
       output = "Highest is  " + four;
				
	 // Outputs highest of four numbers			
    JOptionPane.showMessageDialog(null, output);
    System.exit(0);
  }
}