User Profile

Collapse

Profile Sidebar

Collapse
colinNeedsJavaHelp
colinNeedsJavaHelp
Last Activity: Mar 27 '07, 10:57 PM
Joined: Feb 15 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • colinNeedsJavaHelp
    replied to Palindrome assignment
    in Java
    ok so this is what I have for the code so far:

    Code:
    import java.io.*;
    import java.util.*;
    public class PalTest
      {
       public static void main(String[] args)
       throws java.io.IOException   
      {
       String inputString;
       StringBuffer S;
    
       InputStreamReader isr = new InputStreamReader(System.in);
       
       BufferedReader br = new BufferedReader(isr);
    ...
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    started a topic Palindrome assignment
    in Java

    Palindrome assignment

    I am still having an exceptional amount of trouble with java. This is my new assignment, if anyone can help I would greatly appreciate it. I don't even know where to start.

    A word or phrase in which the letters spell the same message when written forward and backward (with whitespaces and punctuations not considered) is called a palindrome.

    Write a simple Java program that detects palindromes. Your program should be...
    See more | Go to post

  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    I took out num1 = 0;

    But I have to keep the 2 "for" statements so it does a loop. How can I get it to work? I cannot find anything wrong...
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    Actually instead of assigning "*" to a character I just used it in the output.
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    Ok so I got the program how it should be the only problem is that it doesnt produce the right output. When ran it prompts the user "How many lines?" But then when you put in a number it doesnt do anything, the cursor just moves to the next line and stays there. I have to turn this in tomorrow morning so if anyone knows what is going wrong I would appreciate the help. I also changed it to a for loop. The part where the mistake is has...
    See more | Go to post
    Last edited by colinNeedsJavaHelp; Feb 27 '07, 11:44 PM. Reason: clarification

    Leave a comment:


  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    for/while loop

    What is the difference?
    See more | Go to post
    Last edited by colinNeedsJavaHelp; Feb 26 '07, 08:47 AM. Reason: Trying to delete the post

    Leave a comment:


  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    here is my most recent code:
    Code:
    import java.io.*;
    import java.util.*;
    
    public class MagicPrinter
    {
    public static void main(String[] args)
    throws java.io.IOException
    {
    String inputString;
    String n1;
    int num1;
    char a;
    a = '*';
    //for the input stream
    InputStreamReader isr = new InputStreamReader(System.in);
    //needed to use ReadLine()
    ...
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    Ok I now get this error:
    Code:
    MagicPrinter.java:26: unreported exception java.io.IOException; must be caught or declared to be thrown
    inputString = br.readLine();
                             ^
    1 error
    This is what I have for my program:
    Code:
     
    import java.io.*;
    import java.util.*;
    
    public class MagicPrinter
    {
    public static void main(String[] args)
    {
    String inputString;
    ...
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    I dont really know what the variable input is for.. does that look correct though?...
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    Ok so I assigned num1 to be an integer. Then I used this after the input string:

    Code:
    num1 = Integer.parseInt(input.readLine());
    and I get this error:

    Code:
    MagicPrinter.java:24: cannot find symbol
    symbol  : variable input
    location: class MagicPrinter
    num1 = Integer.parseInt(input.readLine());
                            ^
    1 error
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    I want to print lines between odd numbers 3 and 79...
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    Yeah I realized after posting I made a ton of errors. Here is what I have now
    Code:
    import java.io.*;
    import java.util.*;
    
    public class MagicPrinter
    {
    public static void main(String[] args)
    {
    String inputString;
    String = num1;
    char a;
    a = '*';
    
    //for the input stream
    InputStreamReader isr = new InputStreamReader(System.in);
    //needed to use ReadLine()
    ...
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    replied to Stars pattern program
    in Java
    here is my first attempt:
    Code:
    import java.io.*;
    import java.util.*;
    
    publc class MagicPrinter
    {
    publc static void main(String[] args);
    {
    String inputString;
    double num1;
    char a = "*";
    
    //for the input stream
    InputStreamReader isr = new InputStreamReader(System.in);
    //needed to use ReadLine()
    BufferedReader br = new BufferedReader(isr);
    ...
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    started a topic Stars pattern program
    in Java

    Stars pattern program

    I need the program to prompt the user to input an odd number between 3 and 79 and then the output will look like this:

    for example if they input 5:
    *
    **
    ***
    ****
    *****

    or 9:
    *
    **
    ***
    ****
    *****
    ******
    *******
    ********
    *********
    See more | Go to post

  • I do not understand how you got 84. But I dont have toworry about that. I just need to be able to perform one thing at a time. For example 6 + 5 or 10 * 5 instead of multiple operations in one command. It is a very simplecalculato r
    See more | Go to post

    Leave a comment:


  • colinNeedsJavaHelp
    started a topic Float versus Double
    in Java

    Float versus Double

    I was just wondering if someone could explain the difference of these
    See more | Go to post

  • Code:
    import java.io.*;
    import java.util.*;
    public class Calculator
    {
    public static void main(String[] args)
    throws java.io.IOException
    {
    float num1;
    float oper;
    float num2;
    double result;
    
    InputStreamReader isr = new InputStreamReader(System.in);
    
    BufferedReader br = new BufferedReader(isr);
    
    System.out.println("What do you want to compute?
    ...
    See more | Go to post

    Leave a comment:


  • I found out I need to use the If command.

    Here are my instructions
    It only expects primitive arithmetic expressions involving two operands connected by one of the operators. +,-,*, /

    It only expects non-negative numbers in the input

    It assumes that all numbers are real numbers

    It assumes that the operands and operators in the user-input expressions are separated by spaces. for example...
    See more | Go to post

    Leave a comment:


  • I am not really sure how to do that. I would have to make it perfom seperate calculations based on what the user inputs. How would I do that? I am a very novice programmer....
    See more | Go to post

    Leave a comment:


  • Actually I might need to use the if command i just feel stuck right now
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...