User Profile

Collapse

Profile Sidebar

Collapse
KoreyAusTex
KoreyAusTex
Last Activity: Apr 15 '08, 05:24 AM
Joined: Feb 8 '07
Location: Austin Texas
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • KoreyAusTex
    replied to Missing return statements?
    in Java
    Ok got that fixed, everything compiled correctly, but now I am getting output:

    Card 1 value is - Invalid Value
    Card 2 suit is - Invalid Value
    Card 1 is the 2 of Diamonds.
    Card 2 is the ?? of Diamonds.

    The CardTester file I am using is here:

    Code:
    /**
     * Short program that uses the Card class.
     * NOTE: Not a comprehensive test!
     * @version (10/1/04)
     */
    ...
    See more | Go to post
    Last edited by KoreyAusTex; Apr 15 '08, 01:55 AM. Reason: messed up html tag

    Leave a comment:


  • KoreyAusTex
    replied to Missing return statements?
    in Java
    Would that also apply to getSuit, that is what I was thinking....
    See more | Go to post

    Leave a comment:


  • KoreyAusTex
    started a topic Missing return statements?
    in Java

    Missing return statements?

    If anyone can help me figure out the what the missing return statements are, I think it might be the fact that I need to add a return false in the getValue()?

    Code:
    import java.util.*;
    public class Card
    {
        // instance variables
        //suits
        private int suit;
        private int spades;
        private int hearts;
        private int diamonds;
        private int clubs;
    ...
    See more | Go to post

  • KoreyAusTex
    replied to Guessing a number help.
    in Java
    Sorry I think you misunderstood me, I got confused, I understand I need to move it out, but I wasn't clear on what you were referring too....
    See more | Go to post

    Leave a comment:


  • KoreyAusTex
    replied to Guessing a number help.
    in Java
    Do I know why what? That I have to move it?...
    See more | Go to post

    Leave a comment:


  • KoreyAusTex
    replied to Guessing a number help.
    in Java
    Actually you are using concepts we have yet to learn...
    See more | Go to post

    Leave a comment:


  • KoreyAusTex
    replied to Guessing a number help.
    in Java
    Not sure what you meant, but I think I might have fixed it? The only thing I am having trouble with is when I enter -1 as a guess, it should print the message and then terminate, but I think it has something to do with boolean and int types not working together? Any suggestions?

    Code:
    import java.util.*;
    public class GuessNumber 
    {
        public static void main(String[] args) 
        {
           Scanner
    ...
    See more | Go to post

    Leave a comment:


  • KoreyAusTex
    started a topic Guessing a number help.
    in Java

    Guessing a number help.

    I have written a program using method calls as opposed to nested while loops, or rather a while within a while, but for some reason the only way I can get the program to terminate is to type break in the main method after the method calls. This is not the way I was supposed to do it, any thoughts?

    Code:
    import java.util.*;
    public class GuessNumber 
    {
        public static void main(String[] args) 
        {
    ...
    See more | Go to post

  • Ok, used the pipes instead of & in the while loop and I have this now! Thanks for the advice!
    See more | Go to post

    Leave a comment:


  • I think I have it now, can you tell me what you think, it does what I need it to do but I was wondering if you could comment on the efficiency of the code?
    Code:
    public class OldMcD 
    {
      
        public static void main(String[] args) 
        {
            Scanner stdin = new Scanner(System.in);
            
            System.out.println("Let's sing \"Old MacDonald had a farm\": ");
    ...
    See more | Go to post

    Leave a comment:


  • Thank you for your help, I understand what you are say and will apply it to the program!...
    See more | Go to post

    Leave a comment:


  • I switched the code around a bit but it is still waiting for input even after I entered "no more"
    Code:
     while (!"no more".equals(animal)) 
            { 
                System.out.println("Thanks for playing!");
                break;
            }
    See more | Go to post

    Leave a comment:


  • I think I have been concentrating to hard on this and have not been letting it come to me, I am stuck and trying to implement all the suggestions I have found but no been able to understand....
    See more | Go to post

    Leave a comment:


  • We are not able to use String Tokenizer, we are supposed to use while loops and equals() and that it pretty much it....
    See more | Go to post

    Leave a comment:


  • We are supposed to use equals() for comparing strings not the == != etc....
    See more | Go to post

    Leave a comment:


  • KoreyAusTex
    started a topic Help with program, while loops and equals()
    in Java

    Help with program, while loops and equals()

    I am tired and lost, sitting here on a Friday night trying to finish my program. The program prompts the user to enter a series of animal names and sounds, and print the corresponding verses from the song "Old MacDonald had a farm". The program will continue printing verses until the user enters "no more" instead of an animal name and sound. This is what I have so far:

    Code:
    import java.util.*;
    /**
    ...
    See more | Go to post

  • KoreyAusTex
    replied to Money program
    in Java
    My professor wanted it in the format of 10.03 or 15.34. She didn't let us break it up, if I understand you correctly?...
    See more | Go to post

    Leave a comment:


  • KoreyAusTex
    started a topic Money program
    in Java

    Money program

    I am having a very hard time making this program work right, I am sort of lost and I was wondering if I might get some advice.

    This is what I have so far but I have a rounding error when I use the amount 10.03:

    [CODE=java]public class Money
    {
    public static void main(String[] args)
    {
    double TOTAL_AMOUNT = 10.03;

    int money = (int)(TOTAL_AMO UNT...
    See more | Go to post
    Last edited by Ganon11; Feb 5 '08, 03:16 AM. Reason: Please use the [CODE] tags provided.

  • KoreyAusTex
    replied to Magic Square program run amuck!
    in Java
    By the way why don't you get in touch with the other kid and ask him, you talk to him and I can guarantee YOU ARE WRONG....
    See more | Go to post

    Leave a comment:


  • KoreyAusTex
    replied to Magic Square program run amuck!
    in Java
    can someone please help??
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...