CS 120     Instructor:  Jeffrey Horn     PRACTICE QUIZ 1   NAME:   _____________________ 

 OPEN NOTES, but NOT OPEN COMPUTER and NO COLLABORATION!!!!


  1. Write down EXACTLY what the following code would print in the SYSTEM CONSOLE WINDOW:
    class Quiz1practice
    { public static void main(String[] args)
           {
         String word1, word2, word3, word4, word5;                
         word1="the "; word2="land "; word3="map "; word4="is "; 
         word5 = "not ";

         String sentence = word1 + word3 + word4 +
                           word5 + word1 + word2;          
         System.out.println(sentence);                             
       }
    }




  2. Rewrite the code for the assignment statement for the variable "sentence" so that the program prints out in "Valley speak" (i.e., with the negation at the end!):



  3. This program above must be saved in a file named:  ___________________________