The Artima Developer Community
Sponsored Link

Java Answers Forum
Assignment Help Please

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Blake MacKay

Posts: 5
Nickname: newtojava
Registered: Feb, 2003

Assignment Help Please Posted: Feb 17, 2003 7:46 PM
Reply to this message Reply
Advertisement
I am takimg an on-line intro to Java course and this weeks assignment has me baffled, can anyone help please?
I am to:

1. Request the user to enter a string, such as full name.
2. Once the name is entered, verify that they did enter one.
3. Display a small menu using System.out.println that has the following options:
a. 1. Count the number of characters in the string
b. 2. Find a substring inside the string
c. 3. Display the string in reverse order.
d. 4. Exit the program.
4. Once the string is entered, and the menu is displayed, the user is asked to select an option from the list above. Verify that option entered is 1, 2, 3 or 4. If 4, then exit the program using System.exit(0);. Each of the other options will be represented by a method. If an option other than 1 through 4 has been entered, message the user with the error and allow them to start again.

5.If option 1 is selected, call a method that takes the entered string above as a parameter, and returns an integer, which is the number of characters in the string. Once you have the return value, display it using a System.out.println from the option section, not from the method that calculated it.
6.If option 2 is selected, call a method that takes the entered string above as a parameter, and returns an integer which is the starting location of the substring within the longer string. Once you enter this method, you need to prompt the user to enter a substring to search for. Display a message that indicates the substring was found starting at position xx (which is the returned value).
7.If option 3 is selected, call a method that takes the entered string above as a parameter and returns a string that contains the string above in reversed order. Display that reversed string using System.out.println. You?ll need to create an array in this method that stores the characters in the string.

This is my 6th week of this intro course and I desperatly need help!

Topic: Error executing J2EE server ... Previous Topic   Next Topic Topic: Availability of MDI form in java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use