Results 1 to 9 of 9
Like Tree1Likes
  • 1 Post By Norm

Thread: Please lend a little help....assignment due tonight

  1. #1
    eddieteddie is offline Member
    Join Date
    Sep 2011
    Posts
    5
    Rep Power
    0

    Default Please lend a little help....assignment due tonight

    Hi everyone...

    I feel like this is the end of everything....I cannot do this java, I have reviewed the lecture slides again and again and I still cannot do it....Yes I know I am stupid but I really do need help....

    This is my assignment, and it is simple (For you guys and girls), so please try to help me...

    I have attached the pdf file from my university....

    I am up to point 13....where I have to use "charAt" and arrays etc...I am extremely confused here....

    Basically the end result is I need to make the program ask the user what letters to put, using S, P, A, R , E.

    Then the program will see where each of those letter is placed, and the different possibilities are Spear, Spare, Parse, Reaps, etc.

    Sigh....

    I hope I can get some help from here...It is due tonight...And yes I have read the lecture slides again and again...I even talked to the teacher, which helped me a lot but still not enough....

    Thank you...

    *cry*




    ====================================

    School of Computer and Information Science ©ECU 9/8/11
    CSP1150/4150 Programming Principles
    Workshop 5
    Title: Repetition
    Objectives from Unit Outline:
    • demonstrate, at an introductory level, a knowledge of the vocabulary and
    syntax of the Java language
    • implement fundamental control structures and program sub-structures in
    Java including classes and objects, methods and inheritance
    Objectives:
    • to write a program using decisions, operators, repetition
    Assessment:
    • Below you will find instructions for Stage 2 of the Workshop Assessment
    Task for this unit.
    • Due Date: before midnight Wednesday 7th September.
    CSP1150/4150 Programming Principles page 2
    The Digital Billboard – Stage 2
    This is the second stage of the Workshop Assessment Task. For details of the task,
    dues dates, and assessment value, see WorkshopAssessmentTask.pdf on
    BlackBoard, under Assessments.
    Requirements for Stage 2:
    In Stage 1, you wrote a Java program that uses the DigitalBillboardFrame class
    to create a display that looks like this:
    For Stage 2, you are to write a similar program that can display other words made
    out of these letters. Your program should
    1. Ask the user to enter a 5 letter word made up of the letters ‘s’, ‘p’, ‘a’, ‘r’ and
    ‘e’ – examples: pares, reaps, spear.
    2. Displays the word entered by the user, on the digital billboard, in about the
    middle of the billboard (so not in the top left like in Stage 1).
    3. Your program does not have to check that the user enters a valid word, but it
    should leave an empty space if the word contains any letter other than these
    5, and should still write the rest of the letters.
    4. The program should then go back to step 1 and ask the user for another
    word.
    5. The program will terminate when the user closes the digital billboard window.
    Marking Key:
    This Stage is worth a maximum of 6%, with marks allocated as below:
    Programming style, including
    • indenting, use of white space etc.
    • documentation, including Javadcs
    • use of naming conventions
    • use of constants
    close to perfect = 2
    good but can be improved = 1
    poor = 0
    Main looping structure Correct main loop (request input, display
    word) = 1
    Loop non-functional or missing = 0
    Looping over letters of words
    Correct letters in correct order = 1
    Incorrect letters = 0
    Letters drawn correctly Correct appearance in correct location =
    2
    CSP1150/4150 Programming Principles page 3
    Error in appearance or location = 1
    Appearance and location incorrect = 0
    Total (max) 6
    Instructions:
    Follow these instructions, and ask your tutor for help if you get stuck.
    1. Make a copy of your Stage 1 project folder on your desktop, or in another
    suitable location. Rename the folder Stage2
    2. Open the project in BlueJ. You should see this:
    3. Now you can either create a new class called DynamicBillboard, or you can
    rename the StaticBillboard class. In these instructions, I’ll explain how to
    proceed by renaming it. So double-click on StaticBillboard to open the
    editor, and change the line
    public class StaticBillboard
    to
    CSP1150/4150 Programming Principles page 4
    public class DynamicBillboard
    4. Compile the class and you will see that its name has been changed.
    5. Update the Javadoc comment at the top of the class.
    6. Remove all the code from the declaration of START_Y down to the end of the
    main method (do not remove the ‘}’ at the end of the method). The program
    should now compile, but if you run it, you will just see a blank display. Close
    the billboard display to terminate the program.
    7. Now we must add in the code for the main logic of this stage. Here is a
    pseudocode version:
    forever
    get a message from the user
    for each letter in the message
    display the letter
    Note that the indenting in the pseudocode is significant – it determines which
    steps are repeated.
    8. We can begin to convert this into Java. First – how can we create an
    infinitely repeating loop in Java (on purpose)? There is more than one way,
    but a commonly-used method is this:
    // forever
    for(;;)
    {
    // get a message from the user
    // for each letter in the message
    // display the letter
    }
    Add the code above into your program and compile it.
    9. Now add in code to get the message to be displayed from the user. I suggest
    you use a Scanner object for this. So you will need to do the following:
    a. add an import statement for the Scanner class
    b. add code to declare and create a Scanner object
    c. add code to declare a String variable to hold the message
    d. add code to prompt the user to enter a message
    e. add code to call the nextLine method on the Scanner object to get the
    message from the user
    f. optionally, at this point you could use the String method trim to
    remove leading and trailing blank letters from the message.
    a. will go at the top of the source file, b and c could go somewhere
    near the top of the main method, and d and e should go in the loop,
    just after the comment // get a message from the user.
    CSP1150/4150 Programming Principles page 5
    10. Compile and test this much – the display will still be blank, but the program
    should repeatedly ask the user to enter a message, and wait for the user to
    input one.
    11. Now we have to figure out how to do this part:
    // for each letter in the message
    // display the letter
    12. This is going to need another loop, so we will be using nested loops to solve
    this problem. Our choice is between a for, a while and a do-while. The
    simplest way here seems to be a for loop. We want to display each letter in
    the word in order, and a simple for loop to do this looks like:
    for(int i = 0; i < ???; i++)
    {
    // display the i_th letter
    }
    where ??? must be replaced by some code (an expression) which
    represents the number of times to go around the loop. The variable i is a
    “loop counter” which can be used to keep track of which letter is to be
    displayed.
    Add this code to your program, replacing the ???: with a suitable expression.
    13. So that you can check this much, add in a line after the comment // display
    the i_th letter, to print out the ith letter to the console (so don’t attempt to
    display it in the billboard for now). You can get the ith letter by calling the
    charAt method on the String object containing the message. Your program
    should have code that looks like this:
    // forever
    for(;;)
    {
    // get a message from the user
    … your code for getting the message goes in here …
    // for each letter in the message
    for(int i = 0; i < ???; i++)
    {
    // display the i_th letter
    … your code to print the letter goes here …
    }
    }
    When you have added in your parts, compile and test this much.
    14. The final task is to figure out how to display each letter on the billboard in the
    correct location. There are two parts to this: figuring out where each letter
    should be drawn (each letter needs to go further to the right than the
    previous one), and figuring out which grid cells to turn on to display the right
    letter.
    CSP1150/4150 Programming Principles page 6
    First we are just going to add code to figure out where each of the letters will
    go, without drawing them. For this, we will introduce two new variables, x
    and y, that will keep track of where the top-left location of each letter will be.
    For the first letter, x should be START_X and y should be START_Y. After each
    letter is drawn, x should be increased by LETTER_WIDTH+GAP.
    So your code should be modified by adding code like so:
    // forever
    for(;;)
    {
    // get a message from the user
    … your code for getting the message goes in here …
    // for each letter in the message
    int x = START_X; // keep track of where each letter should go
    int y = START_Y;
    for(int i = 0; i < ???; i++)
    {
    // display the i_th letter
    … your code to print the letter goes here …
    x += LETTER_WIDTH + GAP;
    }
    }
    15. Hang in there – we are nearly done! The final step is to add in the calls to
    allOff, turnOn and redisplay on the DigitalBillboardFrame object, as you
    did in Stage 1. The difference is that in Stage 1, you always displayed the
    same letters in the same order. Now you will have to make sure that your
    code makes the right turnOn calls to draw each letter – and the choice will be
    different depending on which letter is being drawn.
    This can be achieved with a switch statement like so:
    switch(???)
    {
    case ‘s’:
    … insert the right turnOn class for a letter s
    break;
    case ‘p’:
    … insert the right turnOn class for a letter p
    break;
    case ‘a’:
    … insert the right turnOn class for a letter a
    break;
    case ‘r’:
    … insert the right turnOn class for a letter r
    break;
    case ‘e’:
    … insert the right turnOn class for a letter e
    break;
    default:
    }
    Where ??? is replaced by your call to the charAt method, and the right
    sequence of turnOn calls can be found in your Stage 1 solution (but you will
    CSP1150/4150 Programming Principles page 7
    need to change the calls to use the x and y values that represent the correct
    location for each letter).
    When you have inserted this code and made your corrections, your program
    should contain code that looks something like:
    // forever
    for(;;)
    {
    // get a message from the user
    … your code for getting the message goes in here …
    // for each letter in the message
    int x = START_X; // keep track of where each letter should go
    int y = START_Y;
    for(int i = 0; i < ???; i++)
    {
    // display the i_th letter
    switch(???)
    {
    case ‘s’:
    … insert the right turnOn class for a letter s
    break;
    case ‘p’:
    … insert the right turnOn class for a letter p
    break;
    case ‘a’:
    … insert the right turnOn class for a letter a
    break;
    case ‘r’:
    … insert the right turnOn class for a letter r
    break;
    case ‘e’:
    … insert the right turnOn class for a letter e
    break;
    default:
    }
    // adjust the position of the next letter
    x += LETTER_WIDTH + GAP;
    }
    }
    You will also need to add calls to allOff and redisplay in the right places.
    16. All that is needed now is to correct any errors, test thoroughly, and tidy up
    the code before submission.
    17. How many different 5 letter words can you make using the 5 letters ‘s’, ‘p’,
    ‘a’, ‘r’, and ‘e’?
    Submission:
    When your program is working correctly and you have tidied up your code,
    • submit only your source file DynamicBillboard.java via the Assessment
    page on BlackBoard.
    CSP1150/4150 Programming Principles page 8
    • Please ensure that you “submit” – do not simply “save”
    • Check your submission on BlackBoard under Tools->My Grades (you
    should see a ! for this assessment)
    • The due date is midnight, Wednesday 7th September. After this time, the
    usual late penalties apply.
    • Within a few days after the due date, you should find your mark and
    feedback on BlackBoard under Tools->My Grades.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default Re: Please lend a little help....assignment due tonight

    assignment due tonight
    Do not mention your deadline. Your time constraints are your problem not ours. Many like me are less likely to help those you post their deadlines. Which results in a decrease in the chance of getting help not an increase.

    If you need help then you should post your code or a SSCCE (google it) as well as your error messages and ask a specific question. "I need help with my code" or "It doesn't work" is not specific.

  3. #3
    eddieteddie is offline Member
    Join Date
    Sep 2011
    Posts
    5
    Rep Power
    0

    Default Re: Please lend a little help....assignment due tonight

    Thank you and sorry for that.

    Well, I have done all my best, and this is as far as I got, up to step 13 and then I simply have no idea what to do.

    Last night was a sleepless night, and tonight will be too I think..

    Here is the work that I did as much as I can..

    Java Code:
    import billboard.BillboardInterface;
    import billboard.DigitalBillboardFrame;
    import java.util.Scanner;
    
    /**
     * Partial solution for Stage 1 of the digital billboard
     *
     * @author phi
     * @version 2011 2
     */
    public class DynamicBillboard
    
    {
        public static void main(String[] args)
        {
            // initial size of the display in pixels
            final int WINDOW_WIDTH = 300;
            final int WINDOW_HEIGHT = 120;
            // size of the grid for the digital billboard
            final int BB_WIDTH = 50;
            final int BB_HEIGHT = 30;
    
            // create a billboard
            BillboardInterface billboard = new DigitalBillboardFrame(
                    "SCSS",
                    WINDOW_WIDTH, WINDOW_HEIGHT,
                    BB_WIDTH, BB_HEIGHT);
    
            // we will make letters 5 cells wide and 12 high
            final int LETTER_WIDTH = 5;
            final int LETTER_HEIGHT = 12;
            // and leave a 1 cell gap between letters
            final int GAP = 1;
    
            // the top left of the first letter in the word will be 2 cells from the left and 1 down
            final int START_X = 2;
            final int START_Y = 1;
            
            Scanner Keyboard = new Scanner (System.in);
            String userMsg ="";
            
            
            
            
            
            
            
            // forever
                for(;;)
                {
                  System.out.println("Please enter a message: ");
                  userMsg = Keyboard.nextLine();
                  String v = "";
                  String result = v.trim(); 
                
                // get a message from the user
                
                // for each letter in the message
                    int x = START_X; 
                    int y = START_Y;
                    for(int i = 0; i < 5; i++)
                    {
                      // display the i_th letter
                      switch (5)
                      {
                        case 's':
                        billboard.turnOn(START_X+1, START_Y+2);
                        billboard.turnOn(START_X+2, START_Y+2);
                        billboard.turnOn(START_X+3, START_Y+2);
                        billboard.turnOn(START_X+4, START_Y+2);
                        billboard.turnOn(START_X, START_Y+3);
                        billboard.turnOn(START_X, START_Y+4);
                        billboard.turnOn(START_X+1, START_Y+5);
                        billboard.turnOn(START_X+2, START_Y+5);
                        billboard.turnOn(START_X+3, START_Y+5);
                        billboard.turnOn(START_X+4, START_Y+6);
                        billboard.turnOn(START_X+4, START_Y+7);
                        billboard.turnOn(START_X, START_Y+8);
                        billboard.turnOn(START_X+1, START_Y+8);
                        billboard.turnOn(START_X+2, START_Y+8);
                        billboard.turnOn(START_X+3, START_Y+8);
            
                        break;
                        
                        final int START_X1 = 8;
                        final int START_Y1 = 1; 
                                             
                        case 'p':
                        billboard.turnOn(START_X1, START_Y1+2);
                        billboard.turnOn(START_X1+1, START_Y1+2);
                        billboard.turnOn(START_X1+2, START_Y1+2);
                        billboard.turnOn(START_X1+3, START_Y1+2);
                        billboard.turnOn(START_X1, START_Y1+3);
                        billboard.turnOn(START_X1, START_Y1+4);
                        billboard.turnOn(START_X1, START_Y1+5);
                        billboard.turnOn(START_X1, START_Y1+6);
                        billboard.turnOn(START_X1, START_Y1+7);
                        billboard.turnOn(START_X1, START_Y1+8);
                        billboard.turnOn(START_X1, START_Y1+9);
                        billboard.turnOn(START_X1, START_Y1+10);
                        billboard.turnOn(START_X1, START_Y1+11);
                        billboard.turnOn(START_X1+1, START_Y1+8);
                        billboard.turnOn(START_X1+2, START_Y1+8);
                        billboard.turnOn(START_X1+3, START_Y1+8);
                        billboard.turnOn(START_X1+4, START_Y1+3);
                        billboard.turnOn(START_X1+4, START_Y1+4);
                        billboard.turnOn(START_X1+4, START_Y1+5);
                        billboard.turnOn(START_X1+4, START_Y1+6);
                        billboard.turnOn(START_X1+4, START_Y1+7);
                        
                        break;
                        
                        final int START_X2 = 14;
                        final int START_Y2 = 1;
                        
                        case 'a':
                        billboard.turnOn(START_X2, START_Y2+3);
                        billboard.turnOn(START_X2, START_Y2+4);
                        billboard.turnOn(START_X2, START_Y2+5);
                        billboard.turnOn(START_X2, START_Y2+6);
                        billboard.turnOn(START_X2, START_Y2+7);
                        billboard.turnOn(START_X2+1, START_Y2+2);
                        billboard.turnOn(START_X2+1, START_Y2+8);
                        billboard.turnOn(START_X2+2, START_Y2+2);
                        billboard.turnOn(START_X2+2, START_Y2+8);
                        billboard.turnOn(START_X2+3, START_Y2+2);
                        billboard.turnOn(START_X2+3, START_Y2+3);
                        billboard.turnOn(START_X2+3, START_Y2+4);
                        billboard.turnOn(START_X2+3, START_Y2+5);
                        billboard.turnOn(START_X2+3, START_Y2+6);
                        billboard.turnOn(START_X2+3, START_Y2+7);
                        billboard.turnOn(START_X2+4, START_Y2+8);
                        
                        break;
                 
                         final int START_X3 = 20;
                         final int START_Y3 = 1;
                        
                        case 'r':
                        billboard.turnOn(START_X3, START_Y3+2);
                        billboard.turnOn(START_X3+1, START_Y3+3);
                        billboard.turnOn(START_X3+1, START_Y3+4);
                        billboard.turnOn(START_X3+1, START_Y3+5);
                        billboard.turnOn(START_X3+1, START_Y3+6);
                        billboard.turnOn(START_X3+1, START_Y3+7);
                        billboard.turnOn(START_X3+1, START_Y3+8);
                        billboard.turnOn(START_X3+2, START_Y2+2);
                        billboard.turnOn(START_X3+3, START_Y2+2);
                        billboard.turnOn(START_X3+4, START_Y2+3);
                        
                        break;
                        
                        final int START_X4 = 26;
                        final int START_Y4 = 1;
                        
                        case 'e':
                         billboard.turnOn(START_X4, START_Y4+3);
                         billboard.turnOn(START_X4, START_Y4+4);
                         billboard.turnOn(START_X4, START_Y4+5);
                         billboard.turnOn(START_X4, START_Y4+6);
                         billboard.turnOn(START_X4, START_Y4+7);
                         billboard.turnOn(START_X4+1, START_Y4+2);
                         billboard.turnOn(START_X4+1, START_Y4+5);
                         billboard.turnOn(START_X4+1, START_Y4+8);
                         billboard.turnOn(START_X4+2, START_Y4+2);
                         billboard.turnOn(START_X4+2, START_Y4+5);
                         billboard.turnOn(START_X4+2, START_Y4+8);
                         billboard.turnOn(START_X4+3, START_Y4+2);
                         billboard.turnOn(START_X4+3, START_Y4+5);
                         billboard.turnOn(START_X4+3, START_Y4+8);
                         billboard.turnOn(START_X4+4, START_Y4+3);
                         billboard.turnOn(START_X4+4, START_Y4+4);
                         billboard.turnOn(START_X4+4, START_Y4+7);
                         
                         break;
                         
                        default:
                       
                      
                      
                      x += LETTER_WIDTH + GAP;
                      
                    }
                // display the letter
            }
        }
    }
    }

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: Please lend a little help....assignment due tonight


  5. #5
    eddieteddie is offline Member
    Join Date
    Sep 2011
    Posts
    5
    Rep Power
    0

    Default Re: Please lend a little help....assignment due tonight

    Yes I posted on two forums to get more help. Surely there is nothing wrong with that....?

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: Please lend a little help....assignment due tonight

    There is no problem as long as you post a link to all the forums where you have posted the question.
    We're not in competition and don't like wasting time answering questions that have already been answered.
    Fubarable likes this.

  7. #7
    eddieteddie is offline Member
    Join Date
    Sep 2011
    Posts
    5
    Rep Power
    0

    Default Re: Please lend a little help....assignment due tonight

    Here, I have done much to improve, I think I am close to it.

    Java Code:
    import billboard.BillboardInterface;
    import billboard.DigitalBillboardFrame;
    import java.util.Scanner;
    
    /**
     * Partial solution for Stage 1 of the digital billboard
     *
     * @author phi
     * @version 2011 2
     */
    public class DynamicBillboard
    
    {
        public static void main(String[] args)
        {
            // initial size of the display in pixels
            final int WINDOW_WIDTH = 300;
            final int WINDOW_HEIGHT = 120;
            // size of the grid for the digital billboard
            final int BB_WIDTH = 50;
            final int BB_HEIGHT = 30;
    
            // create a billboard
            BillboardInterface billboard = new DigitalBillboardFrame(
                    "SCSS",
                    WINDOW_WIDTH, WINDOW_HEIGHT,
                    BB_WIDTH, BB_HEIGHT);
    
            // we will make letters 5 cells wide and 12 high
            final int LETTER_WIDTH = 5;
            final int LETTER_HEIGHT = 12;
            // and leave a 1 cell gap between letters
            final int GAP = 1;
    
            // the top left of the first letter in the word will be 2 cells from the left and 1 down
            final int START_X = 2;
            final int START_Y = 1;
            
            Scanner Keyboard = new Scanner (System.in);
            String userMsg ="";
            String g;
            
            
             
            // forever
                for(;;)
                {
                  System.out.println("Please enter a message: ");
                  userMsg = userMsg.trim();
                  g = userMsg.length();
                  charAt(i);
                
                // get a message from the user
                           
                // for each letter in the message
                    int x = START_X; 
                    int y = START_Y;
                    for(int i = 0; i < 5; i++)
                    {
                      // display the i_th letter
                      switch (userMsg.charAt(g))
                        {     
                            case (charAt(1)):
                                  
                            billboard.turnOn(START_X+1, START_Y+2);
                            billboard.turnOn(START_X+2, START_Y+2);
                            billboard.turnOn(START_X+3, START_Y+2);
                            billboard.turnOn(START_X+4, START_Y+2);
                            billboard.turnOn(START_X, START_Y+3);
                            billboard.turnOn(START_X, START_Y+4);
                            billboard.turnOn(START_X+1, START_Y+5);
                            billboard.turnOn(START_X+2, START_Y+5);
                            billboard.turnOn(START_X+3, START_Y+5);
                            billboard.turnOn(START_X+4, START_Y+6);
                            billboard.turnOn(START_X+4, START_Y+7);
                            billboard.turnOn(START_X, START_Y+8);
                            billboard.turnOn(START_X+1, START_Y+8);
                            billboard.turnOn(START_X+2, START_Y+8);
                            billboard.turnOn(START_X+3, START_Y+8);
            
                            break;
                        }
                        
                        final int START_X1 = 8;
                        final int START_Y1 = 1; 
                        
                      switch (userMsg.charAt(g))
                        {                     
                            case (charAt(2)):
                            
                            billboard.turnOn(START_X1, START_Y1+2);
                            billboard.turnOn(START_X1+1, START_Y1+2);
                            billboard.turnOn(START_X1+2, START_Y1+2);
                            billboard.turnOn(START_X1+3, START_Y1+2);
                            billboard.turnOn(START_X1, START_Y1+3);
                            billboard.turnOn(START_X1, START_Y1+4);
                            billboard.turnOn(START_X1, START_Y1+5);
                            billboard.turnOn(START_X1, START_Y1+6);
                            billboard.turnOn(START_X1, START_Y1+7);
                            billboard.turnOn(START_X1, START_Y1+8);
                            billboard.turnOn(START_X1, START_Y1+9);
                            billboard.turnOn(START_X1, START_Y1+10);
                            billboard.turnOn(START_X1, START_Y1+11);
                            billboard.turnOn(START_X1+1, START_Y1+8);   
                            billboard.turnOn(START_X1+2, START_Y1+8);
                            billboard.turnOn(START_X1+3, START_Y1+8);
                            billboard.turnOn(START_X1+4, START_Y1+3);
                            billboard.turnOn(START_X1+4, START_Y1+4);
                            billboard.turnOn(START_X1+4, START_Y1+5);
                            billboard.turnOn(START_X1+4, START_Y1+6);
                            billboard.turnOn(START_X1+4, START_Y1+7);
                            
                            break;
                        }
                        final int START_X2 = 14;
                        final int START_Y2 = 1;
                      switch (userMsg.charAt(g))
                        {
                        
                            case (charAt(3)):
                            billboard.turnOn(START_X2, START_Y2+3); 
                            billboard.turnOn(START_X2, START_Y2+4);
                            billboard.turnOn(START_X2, START_Y2+5);
                            billboard.turnOn(START_X2, START_Y2+6);
                            billboard.turnOn(START_X2, START_Y2+7);
                            billboard.turnOn(START_X2+1, START_Y2+2);
                            billboard.turnOn(START_X2+1, START_Y2+8);
                            billboard.turnOn(START_X2+2, START_Y2+2);
                            billboard.turnOn(START_X2+2, START_Y2+8);
                            billboard.turnOn(START_X2+3, START_Y2+2);
                            billboard.turnOn(START_X2+3, START_Y2+3);
                            billboard.turnOn(START_X2+3, START_Y2+4);
                            billboard.turnOn(START_X2+3, START_Y2+5);
                            billboard.turnOn(START_X2+3, START_Y2+6);
                            billboard.turnOn(START_X2+3, START_Y2+7);
                            billboard.turnOn(START_X2+4, START_Y2+8);
                            
                            break;
                        }
                         final int START_X3 = 20;
                         final int START_Y3 = 1;
                      switch (userMsg.charAt(g))
                        {
                             case (charAt(4)):
                             billboard.turnOn(START_X3, START_Y3+2);
                             billboard.turnOn(START_X3+1, START_Y3+3);
                             billboard.turnOn(START_X3+1, START_Y3+4);
                             billboard.turnOn(START_X3+1, START_Y3+5);
                             billboard.turnOn(START_X3+1, START_Y3+6);
                             billboard.turnOn(START_X3+1, START_Y3+7);
                             billboard.turnOn(START_X3+1, START_Y3+8);
                             billboard.turnOn(START_X3+2, START_Y2+2);
                             billboard.turnOn(START_X3+3, START_Y2+2);
                             billboard.turnOn(START_X3+4, START_Y2+3);
                             
                             break;
                         }
                             
                             final int START_X4 = 26;
                             final int START_Y4 = 1;
                       
                      switch (userMsg.charAt(g))
                        {
                        
                                case (charAt(5)):
                                billboard.turnOn(START_X4, START_Y4+3);
                                billboard.turnOn(START_X4, START_Y4+4);
                                billboard.turnOn(START_X4, START_Y4+5);
                                billboard.turnOn(START_X4, START_Y4+6);
                                billboard.turnOn(START_X4, START_Y4+7);
                                billboard.turnOn(START_X4+1, START_Y4+2);
                                billboard.turnOn(START_X4+1, START_Y4+5);
                                billboard.turnOn(START_X4+1, START_Y4+8);
                                billboard.turnOn(START_X4+2, START_Y4+2);
                                billboard.turnOn(START_X4+2, START_Y4+5);
                                billboard.turnOn(START_X4+2, START_Y4+8);
                                billboard.turnOn(START_X4+3, START_Y4+2);
                                billboard.turnOn(START_X4+3, START_Y4+5);
                                billboard.turnOn(START_X4+3, START_Y4+8);
                                billboard.turnOn(START_X4+4, START_Y4+3);
                                billboard.turnOn(START_X4+4, START_Y4+4);
                                billboard.turnOn(START_X4+4, START_Y4+7);
                                
                                break;
                         }
    
                       
                      
                      
                      x += LETTER_WIDTH + GAP;
                      
                    }
                // display the letter
            }
        }
    }


    That is all the work I have done, it seems there is only a few more to do.

    I keep getting this error "incompatible type"

    What do I do?

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: Please lend a little help....assignment due tonight

    I keep getting this error "incompatible type"
    What do I do?
    You need to post the full text of the error so we can see what the problem is.

  9. #9
    zaxon1987 is offline Member
    Join Date
    Sep 2011
    Posts
    1
    Rep Power
    0

    Default Re: Please lend a little help....assignment due tonight

    Haha I am in the SAME class as you and I am also having trouble. Hope you
    figured it out.

Similar Threads

  1. Must get some help tonight
    By mahirul in forum New To Java
    Replies: 8
    Last Post: 12-07-2010, 04:18 AM
  2. Replies: 8
    Last Post: 06-06-2010, 03:10 PM
  3. Assignment due tonight, please help me!
    By twiggy62 in forum New To Java
    Replies: 4
    Last Post: 02-09-2010, 06:07 AM
  4. Need with my assignment ...
    By allergy01 in forum New To Java
    Replies: 1
    Last Post: 04-25-2009, 08:33 AM
  5. Can somebody help me in my assignment
    By coolstruxx in forum NetBeans
    Replies: 0
    Last Post: 03-24-2009, 01:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •