Results 1 to 10 of 10
  1. #1
    manibby93 is offline Member
    Join Date
    Sep 2013
    Posts
    77
    Rep Power
    0

    Default Write a tbl that determines the expressions for the number of each type of char...???

    I have ZERO clue how to do this. Please, help me. I know how to make this, but not how to make a table.

    Write a table that determines the expressions for the number of each type of character on each of the 6 lines in the following output.

    !!!!!!!!!!!!!!!!!!!!!!

    \\!!!!!!!!!!!!!!!!!!//

    \\\\!!!!!!!!!!!!!!////

    \\\\\\!!!!!!!!!!//////

    \\\\\\\\!!!!!!////////

    \\\\\\\\\\!!//////////

  2. #2
    AndrewM16921 is offline Senior Member
    Join Date
    Jan 2009
    Location
    NJ, USA
    Posts
    263
    Rep Power
    6

    Default Re: Write a tbl that determines the expressions for the number of each type of char..

    What exactly is meant by "table?" Like, a list of input/output perhaps? Perhaps with an input (the i-th line) mapped to the output (# \'s, # !'s, # /'s)? It seems worded in a very vague way.

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,015
    Blog Entries
    7
    Rep Power
    20

    Default Re: Write a tbl that determines the expressions for the number of each type of char..

    Quote Originally Posted by manibby93 View Post
    Write a table that determines the expressions for the number of each type of character on each of the 6 lines in the following output.
    There's only one type of character; it's 'char'; please rephrase your question; as it is it doesn't make sense.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    manibby93 is offline Member
    Join Date
    Sep 2013
    Posts
    77
    Rep Power
    0

    Default Re: Write a tbl that determines the expressions for the number of each type of char..

    That's all my professor said to do. I can't reword it if that's what the assignment is. I guess by a table, she means a table...a chart. I ran out of space to write "character" in my question. I don't understand what that has to do with anything unless I'm misunderstanding something. By character, I guess she's referring to the symbols.

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    2,940
    Rep Power
    4

    Default Re: Write a tbl that determines the expressions for the number of each type of char..

    You need to talk to her about this. Unless something was omitted from her instructions or it was related to an in class discussion, it doesn't make sense as worded. And you can also talk to your class mates.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  6. #6
    manibby93 is offline Member
    Join Date
    Sep 2013
    Posts
    77
    Rep Power
    0

    Default Re: Write a tbl that determines the expressions for the number of each type of char..

    OHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH HHHHHHHHHHHH, it's a LOOP TABLE she wants.

  7. #7
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    2,940
    Rep Power
    4

    Default Re: Write a tbl that determines the expressions for the number of each type of char..

    Well, I'm glad you understand it. What's a loop table?

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  8. #8
    manibby93 is offline Member
    Join Date
    Sep 2013
    Posts
    77
    Rep Power
    0

    Default Re: Write a tbl that determines the expressions for the number of each type of char..

    Here it is:
    Write a tbl that determines the expressions for the number of each type of char...???-tbl.jpg

    For example, for this:

    Write a tbl that determines the expressions for the number of each type of char...???-output.jpg

    the expressions for the backslashes and forwardslashes would be: line*2-2. There are six lines, so the line number is multiplied by 2 and from that, you subtract 2 to get the amount of backslashes and forwardslashes. With the exclamation points, however, I'm lost because they decline as the lines increase, but I do know that for line 1, there are 22 exclamation points, and they decrease by 4 as the lines increase. I just need help with that part first. It randomly came to me. Sorry for the confusion!

  9. #9
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,015
    Blog Entries
    7
    Rep Power
    20

    Default Re: Write a tbl that determines the expressions for the number of each type of char..

    Let's start counting the lines from zero and write down the number of back slashes, exclamation points and foreward slashes:

    Java Code:
    line#0:  0 22  0
    line#1:  2 18  2
    line#2:  4 14  4
    line#3:  6 10  6
    line#4:  8  6  8
    line#5: 10  2 10
    As you can see on line #i there are 2*i slashes (of both types); there are always 22 characters on a line, so there are 22-2*2*i exclamation points on line #i.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    manibby93 is offline Member
    Join Date
    Sep 2013
    Posts
    77
    Rep Power
    0

    Default Re: Write a tbl that determines the expressions for the number of each type of char..

    Thanks again!! Sorry for the confusion again.

Similar Threads

  1. Replies: 7
    Last Post: 11-30-2011, 06:58 PM
  2. Replies: 2
    Last Post: 11-26-2011, 02:01 PM
  3. Replies: 4
    Last Post: 03-21-2011, 09:49 PM
  4. Char type for first character typed?
    By Sageinquisitor in forum New To Java
    Replies: 3
    Last Post: 07-17-2007, 07:08 AM
  5. return type determines override/overload?
    By hedefalk in forum Advanced Java
    Replies: 4
    Last Post: 07-11-2007, 01:48 PM

Posting Permissions

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