Question: JAVA!! Create your own silly story (not this one) based on information provided by the user. For example, the parts in bold were entered by
JAVA!! Create your own silly story (not this one) based on information provided by the user. For example, the parts in bold were entered by the user. For ideas see: Mad Libs
My Silly Story name: Frank Zhang whole number: 345 body part: stomach noun: cup floating point number: 1.23 clothing article: hat destination: Colorado goal: degree
The resulting story is:
Congratulations! Today is your 345 day. You're off to Colorado! You're off and away! You have brains in your stomach, You have feet in your hat. You can steer yourself any direction you choose. You're on your own with $1.23. And you know what you know. And YOU are the cup who'll decide where to go. be your name Frank Zhang or Bixby or Bray or Mordecai Ali Van Allen O'Shea, You're off to Colorado! Today is your day! Your degree is waiting. So...get on your way! Based on Dr. Seuss "Oh, the Places You'll Go!" and adapted by Bob Smith
Requirements: The main method should contain all input code (e.g., Scanner instance) and have at least 5 user prompts inputting values with nextInt(), nextDouble(), next() and nextLine(). All output code (e.g., print statements) must be in the main method as well.
The prepareStory method takes the arguments passed in and prepares the entire story, using at least 5 parameters, as one long String that is returned. The author's name (e.g., the same name that is in the file header comment) must be included in the String that is returned. Don't pass the author's name as a parameter, but include as a string literal within the prepareStory method.
/** * Returns a String that is a story containing at least 5 of the arguments passed in. Also, your story must include * the author's name (your name) within it using a string literal (don't pass as a parameter).Your name must match the name * within the File Header Comment. * * There are no input or output statements within this method. All input and * output is done in the main method and the user must be prompted for all the arguments. * * Note: Your method must have the name 'prepareStory', must have 8 parameters with the same data types shown and * in the same order. * However, you may change the parameter names to match values in your story. For example, you may want * to prompt for a verb, and store in a String parameter you name verb, or an adjective and store in a String param you * name adjective. * * @param number A whole number * @param destination A destination * @param bodyPart A human body part * @param clothing An article of clothing * @param noun A noun * @param floatNum A floating point number * @param name A person's name * @param goal A goal someone would like to achieve. * @return A story containing at least 5 of the arguments and includes program author's name. */ public static String prepareStory(int number, String destination, String bodyPart, String clothing, String noun, double floatNum, String name, String goal) { return ""; //replace with your code } import java.util.Scanner;
public class MySillyStory {
//add prepareStory method
public static void main(String[] args) {
//prompt the user
//pass the responses to the prepareStory method
//print out the story returned from prepareStory
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
