Write a method named promptstring in java

Assignment Help JAVA Programming
Reference no: EM132095211

Please code in JAVA

Create a program named StarWarsName.java.

The Star Wars universe is a world based on a series of movies from the 70s and then later the late-90s and early-00s. The characters in the stories tend to have very funny names, like: Yoda, Moff Tarkin, Bail Organa, Darth Maul, Ponda Baba, and Edcel Bar Gane. How made up!

For this part of the assignment, you will write you own Star Wars Name Generator, using a simple algorithm that manipulates strings input by the user.

Here are three example sessions:

Star Wars Name Generator Enter your first name: Thom Enter your last name: Yorke Enter your mother's maiden name: Selway Enter the city where you were born: Wellingborough Enter the first car your drove: Audi You are THOYO SEWEL of KEAUDI Star Wars Name Generator Enter your first name: Portia Enter your last name: DeRossi Enter your mother's maiden name: Lee Enter the city where you were born: Horsham Enter the first car your drove: Maserati You are PORDE LEHOR of SIMASERATI Star Wars Name Generator Enter your first name: Emily Enter your last name: Deschanel Enter your mother's maiden name: Weir Enter the city where you were born: Los Angeles Enter the first car your drove: Dodge You are EMIDE WELOS of ELDODGE

Here are the rules your program must follow to generate the Star Wars name and planet:

The user's Star Wars name is composed of a first and last name:

For the first name, use: the first 3 characters of the user's real first name, concatenated with the first 2 characters of the user's real last name.

For the last name, use: the first 2 characters of the user's mother's madien name, concatenated with the first 3 characters of the user's city of birth.

The user's Star Wars planet, use: The last 2 characters of the user's last name, concatenated with the user's car.

In terms of the coding for StarWarsName.java there are additional requirements to earn full credit:

Write a method named promptString, which takes in a String parameter.

The promptString method will print its parameter to the user as a prompt, and then return a String that is the result of reading the console via the nextLine() method.

Note that if you wish to use nextLine in your own programs that it acts strangely when mixed with nextInt and nextDouble. For this program you will use nextLine exclusively.

Use String's trim method to remove any leading or trailing whitespace the user may have entered. For instance, the user input " Ford " should be treated as "Ford".

Your output should be in all uppercase (as shown).

You may assume that all names entered by the user are three or more characters long. But, if you'd like, you can (optionally) enhance your program by doubling the user's input; for example, treating the last name "Xu" as "XuXu".

Reference no: EM132095211

Questions Cloud

Find examples of your representative engaging : Find the Congressional representative (NOT your Senator) from your home district and answer the questions below. To start your research
Write a test program that creates two rectangle objects : A constructor that creates a rectangle with the specified width and height. The default values are 1 and 2 for the width and height, respectively.
Record the adjusting journal entries : On Oct 31, 2015 Devin's Drills Inc. had the following Cash in Bank (Book Balance) of $10,350. Record the adjusting journal entries
Determine and print out the number of quarters : Input the number of quarters, dimes, nickels, and pennies from the user. Print out the number of coins and total value in dollars.
Write a method named promptstring in java : The Star Wars universe is a world based on a series of movies from the 70s and then later the late-90s and early-00s.
What is the machine net present value : At the end of 6 years, the packing machine will be sold for $5,290. Rayburn's required rate of return is 8%. What is the machine's net present value
What are some of the community-specific communication : 1) What are some of the community-specific communication issues that exist in your community? 2) How does your community profile affect risk perception?
Construct a computer program for runge-kutta method : Design and construct a computer program in one of the approved languages that will illustrate the use.
Supplemental handouts folder : First, please read the excerpt from John Rawls A Theory of Justice. This reading can be found in the Supplemental Handouts folder.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd