fork download
  1. ////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Kaylan Wade
  4. // Assignment 1, CS 201 Project
  5. // January 30, 2012
  6. //
  7. ////////////////////////////////////////////////////////////////////////////
  8. import java.util.*;
  9. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  10. //
  11. //DESCRIPTION: This program does the following:
  12. //Asks the user for a favorite color, food, animal, and freind or cousin and then makes a story of a dream with the given information.
  13. //
  14. //INPUTS: The user enters a color, food, animal name, and freind or cousins name.
  15. //
  16. //OUTPUTS: A story based on the names and items given by the user.
  17. //
  18. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  19.  
  20. public class wordreplacement
  21. {
  22. public static void main(String[] args)
  23. {
  24. Scanner keyboard = new Scanner (System.in);
  25. {
  26. String color, food, animal, freind;
  27.  
  28. System.out.println ("What is your favorite color?");
  29.  
  30. color = keyboard.nextLine();
  31.  
  32. System.out.println ("What is your favorite food?");
  33.  
  34. food = keyboard.nextLine();
  35.  
  36. System.out.println ("What is your favorite animal?");
  37.  
  38. animal = keyboard.nextLine();
  39.  
  40. System.out.println ("Who is your favorite freind or cousin?");
  41.  
  42. freind = keyboard.nextLine();
  43.  
  44. System.out.println ("I had a dream that " + freind + " ate a " + color +" "+ animal + " and said it tasted like " + food + "!");
  45.  
  46. }
  47. }
  48. }
  49.  
  50.  
Runtime error #stdin #stdout 0.27s 213120KB
stdin
Standard input is empty
stdout
Standard output is empty