This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help to complete assignment  RSS feed

 
Kris Patel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody help in this?
Prompt the user for an integer which will define the number of groups in your table
Produce an ASCII table from 0 to 127
Your table will be organized into groups of three little columns displaying the same value as a character, in hexadecimaland in decimalvalue. So each number in the table is displayed three times
Each of the groups of little columns will be 8 characters wide and neatly aligned (see sample output below). The alignment has to be neat for values less than 6. What is shown is just an example.
Leave 4 blank spaces between groups.
When you have printed the number of groups defined by the user input start a new line and continue.
When you reach 127, stop printing regardless of which group you are in and print one extra newline character.
Your solution must employ a loop that goes from 0 to 127. Within the loop there must be a second control structure to determine when to start a new line when you have enough groups printed.
Include documentation readable by the javadoc utility suitable to a program of this size.
our documentation should include a general description of what this program does
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37234
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kris,
How far did you get? For example, can you write a main method that prints a message to the user? That reads in that answer and stores it in a variable, etc.

Post how far you get and then someone will give you tips on what to do next.
 
Campbell Ritchie
Marshal
Posts: 55711
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
…and welcome to the Ranch

Beware of some of the lower ASCII characters which are control characters; you can read about them here. Do tell us what happens for U+0007.
They were right to tell you to stop at 127; since ASCII occupies 7 bits, there is no such thing as an ASCII character for 128+.
 
Kris Patel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know about database and table, just a beginner so please help with this'
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kris Patel wrote:Don't know about database and table, just a beginner so please help with this'


You do *not* need a knowledge of databases for this assignment.

When this assignment is referring to "table" (with "rows" and "columns"), it is referring to the output -- meaning how it is to be displayed. There is no database requirement.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!