In this program you will learn to read strings from the keyboard and write them to the monitor. Write a program that asks the user to enter the first name of a friend or relative, a favorite color, a favorite food, and a favorite animal, then prints the following lines with the user's input replacing the items in italics:
I had a dream that name ate a color animal and said that it tasted like food!For example, if the user entered Jake for the person's name, blue for the color, hamburger for the food, and dog for the animal, the output would be:
I had a dream that Jake ate a blue dog and said that it tasted like hamburger!You should use the Keyboard class (provided by the authors' of your text) to make the job of reading strings from the keyboard easy. To use this class, follow these brief instructions:
import cs1.Keyboard;Remember that capitalization is important. There are simple examples of programs that use the Keyboard class in chapter 2 of your text.
Note that 10% of your program grade is based on the readability of your program. This includes things like proper indentation, comments, and the naming of variables and methods. To receive full credit for your program, make sure that you use proper indentation as demonstrated in your text and in class room examples. Also include a comment at the top of each program stating your name, the course, and the purpose of the program:
The program written for this assignment must be turned in by transferring the java source code file to your ftp directory for this class. Only the source code file (i.e., Dream.java) should be turned in and the file must have exactly that name. You were shown how to transfer files to your class ftp directory in lab 1.