Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 20th, 2004, 04:19 PM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to lucky14
Default I Need Help

This is what i need to do, I have no Idea what i am doing. I don't do code i work on the hardware aspect. Please could someone help me

a. Create a class called CharacterArtTools
b. Write the following methods:

public void printHorizontalLine(int size, char ch)
// It prints a horizontal line consisting size ch characters
// For example, if size was 5 and ch was $, then it prints $$$$$
// and follows it by an end of line

public void printVerticalLine(int size, char ch)
// It prints a vertical line consisting size ch characters
// For example, if size was 2 and ch was $, then it prints
// $
// $
// and follows it by an end of line

public void printE(int size, char ch)
// Print the letter E of the given size using $ characters
{
// The algorithm to print E is as follows:
// (Picture to the right shows what happens when size = 4, and ch = $
//
// 1. print a horizontal line of size characters $$$$
// 2. print a vertical line of size/2 chars $
// $
// 3. print a horizontal line of size characters $$$$
// 4. print a vertical line of size/2 chars $
// $
// 5. print a horizontal line of size characters $$$$
//
//

}

c. Create the driver class: CharacterArtDriver
d. Write the public static void main(String[] args) method that does the following:
• Declare an int variable called eSize = 0 and a char variables fillChar = ‘$’, userResponse = ‘Y’
• Create a CharacterArtTools object called myCAT
• Tell the user that this program prints the letter E of a given size made up of characters.
• while (the userResponse is NOT a ‘N’)
{
o Ask the user to enter a size and read it
o Ask the user to enter a fill char and read it
o myCAT.printE(size, fillChar);
o Ask the user if he/she wants to try another number and read the userresponse (a Y or N)
}
• Print “Thanks for using the program” message

FOR TESTING IT RUN THE PROGRAM FOR size = 12, ch = ‘$’ and size = 10, ch = ‘+’
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off




All times are GMT -4. The time now is 06:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.