Search:

Type: Posts; User: Tedstriker

Page 1 of 2 1 2

Search: Search took 0.59 seconds.

  1. Replies
    1
    Views
    208

    I have a question about a question

    Hi,

    I'm not looking for anyone to do this question for me, but I was wondering if I could get some clarification on what you think this question is asking:

    "Write a program to determine if a...
  2. Re: Break/Continue example doesn't work with ConsoleReader

    class BreakExample2
    {
    public static void main(String[] args)
    {
    System.out.println("(Please enter a number from 1 to 6)");
    ConsoleReader console = new...
  3. Re: Break/Continue example doesn't work with ConsoleReader

    variable num is already defined in method main(java.lang.String[])

    That is the exact error, with for(int num = 1; num < 6; num++) being highlighted.
  4. Re: Break/Continue example doesn't work with ConsoleReader

    Sorry, the error is related to this line:



    for(int num = 1; num < 6; num++)


    the error is "variable num is already defined in method main(java.lang.string{})
  5. Break/Continue example doesn't work with ConsoleReader

    class BreakExample
    {
    public static void main(String[] args)
    {
    System.out.println("(Please enter a number from 1 to 6)");
    ConsoleReader console = new...
  6. Replies
    2
    Views
    191

    Re: Add a dollar sign to a number

    print.out.format worked, thanks.
  7. Replies
    2
    Views
    191

    Add a dollar sign to a number

    Hi,

    I'm writing a basic program that requires the user to input a number. When the input is printed, I would like to add a dollar sign to it. mu code is as follows:



    class Corruption
    {
    ...
  8. Replies
    11
    Views
    359

    Re: Consecutive number addition

    Sorry for my poor explanations guys. I've been working on this, and made a little progress. this is what I have so far:



    import java.util.Scanner;
    class Adding
    {
    public static void...
  9. Replies
    11
    Views
    359

    Re: Consecutive number addition

    it would be all at once, as in :

    123456789

    the sum is 45.
  10. Replies
    11
    Views
    359

    Re: Consecutive number addition

    Sorry guys, I should have been more specific. The user will input 9 consecutive numbers, and the output needs to be the sum of the numbers.
  11. Replies
    11
    Views
    359

    Consecutive number addition

    Hi everyone,

    Sorry for posting here if this is not the correct place, but I have a question I'm kinda stumped on.

    I need to create a program to add together a row of numbers, something like...
  12. Replies
    3
    Views
    200

    Re: cannot enter a floating point number

    Worked like a charm, thanks alot.
  13. Replies
    3
    Views
    200

    cannot enter a floating point number

    hello,

    I have a little assignment where I have to create a primitive currency converter from CAD to NR. Below is the code I have so far:



    import java.util.Random;
    public class BigDecisions...
  14. Replies
    22
    Views
    367

    Re: Illegal start of expression

    Thought I would post in this thread instead of creating a new one, as my question is related. The next part of the book I'm working with is to add buttons to the window created. The following is my...
  15. Replies
    22
    Views
    367

    Re: Illegal start of expression

    import javax.swing.*;
    class Window extends JFrame
    //beginning of class
    {
    JPanel pnl = new JPanel() ;
    public static void main ( String[] args)
    //beginning of main method
    {...
  16. Replies
    22
    Views
    367

    Re: Illegal start of expression

    Ok, corrected that...looks like its getting better. However, I now get the following error:

    add ( pnl ) ;
    ^

    cannot find symbol - variable pnl
  17. Replies
    22
    Views
    367

    Re: Illegal start of expression

    Now I get this error:
    public Window()
    ^

    invalid method declaration; return type required
  18. Replies
    22
    Views
    367

    Re: Illegal start of expression

    import javax.swing.*;
    class Note extends JFrame
    //beginning of class
    {
    public static void main ( String[] args)
    //beginning of main method
    {
    JPanel pnl = new...
  19. Replies
    22
    Views
    367

    Re: Illegal start of expression

    Thanks Norm, but reading that just doesn't make sense to me. When it says JPanel pnl = newJPanel(); goes before the main method, where would that be? where would the different methods begin and end....
  20. Replies
    22
    Views
    367

    Re: Illegal start of expression

    So I've been messing around with this. While its still wrong, at least I got a different error (class, interface, or enum expected with the ^ under the word void) with this effort:



    import...
  21. Replies
    22
    Views
    367

    Re: Illegal start of expression

    Sorry Norm, but I'm having allot of trouble with this.....I gather my original code is arranged wrong due to the placement of my {s? How should they be arranged?
  22. Replies
    22
    Views
    367

    Re: Illegal start of expression

    the book I'm using reads as follows:

    1) Start a new program that imports all Swing components



    import javax.swing.* ;


    2)Create a subclass of the JFrame class named "Window" containing...
  23. Replies
    22
    Views
    367

    Re: Illegal start of expression

    I tried changing the class name, but it didn't seem to make a difference.

    I tried compiling it through the command prompt, and got the following results:

    Window.java:7: error: ';' expected
    ...
  24. Replies
    22
    Views
    367

    Re: Illegal start of expression

    import javax.swing.*;
    class Window extends JFrame
    {
    public static void main ( String[] args)
    {
    JPanel pnl = new JPanel() ;
    public Window()
    {
    super(...
  25. Replies
    22
    Views
    367

    Illegal start of expression

    import javax.swing.*;
    class Window extends JFrame
    {
    public static void main ( String[] args)
    {
    JPanel pnl = new JPanel() ;
    public Window()
    {
    super(...
Results 1 to 25 of 37
Page 1 of 2 1 2