The Artima Developer Community
Sponsored Link

Java Answers Forum
Need help with this one more question...Im new to programming and learning

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
Sabi g

Posts: 3
Nickname: sabi77
Registered: May, 2010

Need help with this one more question...Im new to programming and learning Posted: May 29, 2010 6:55 PM
Reply to this message Reply
Advertisement
I am use Netbeans IDE and dont know hw to dis question please help.

I have to write a program that allows a user to enter a line of text, translates the message into Abracadabra language and gives the average number of vowels per word in the message(vowels are letters a,e,i,o,u or A,E,I,O,U). The program should contain a class Translator and a graphical user interface called TranslatorGUI.

The class Translator can be used to translate a sentence of words and has the following STATIC methods:
1) a method called translate accepts the sentence as a parameter, splits it into words and returns the translated sentence;

2) A method translateWord translates one word. If the word begins with vowel it returns the word in reverse order, otherwise swaps the first and the last letters in the word;

3) A method beginsWithVowel determines if the specified word begins with a vowel;

4) A method numberOfVowels calculates a number of vowels in a word;

5) A method Average calculates the average number of vowels per word in the sentence;

6) A suitable Main method which demonstrates the Translate method.

I have this UML diagram given here that might be of assistance:
+ translate(sentence : String) : String
- translateWord(word : String) : String
- beginsWithVowels(word : String) : boolean
- numberOfVowels(Word : String) : int
+ average(sentence : String) : double
+ main(args : String[] : void

I also have to write a graphical user interface class called TranslatorGUI. It should be able to manipulate the sentence of words and have the following behavior:
1) Label "Enter a sentence" and the text field to enter the text to translate;

2) Label "Translated sentence" and the text field to display it;

3) Label "Average number of vowels" and the label to display it;

4) A button which is selected to translate the sentence and display the average number of vowels"

The class should also include a main method that prepares a frame in which the panel is displayed.

Please people help wid this and the other topic i have posted. Really need help. Thank you.
-

Topic: Java vertical GridLayout, locale Previous Topic   Next Topic Topic: Need help in java...im new to it plz help

Sponsored Links



Google
  Web Artima.com   

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