Western Oregon University Page 1 of 2 CS-161 Pre-Lab #3 General At the top of the every document that you create (word processing files or source files) include: /** * Description of the class or document. * * @author YOUR NAME * @version CS161 Lab #, mm/dd/yyyy (replace with the last edit date) */ The primary purpose of each pre-lab is to help you prepare to be an active participant during the lab sessions, and to be ready to discuss and understand the material presented in lectures. This is why late submissions are NOT accepted as that defeats the primary purpose of the prelab. However, as these are done prior to class discussions, PRE-LABS are not graded on correctness of your answers, but on whether you have shown a reasonable attempt at investigating and trying to solve the problem. Please feel free to bring up questions during your lecture class about material in the prelabs that you don’t understand or where not able to complete correctly. We will devote some of the lecture time to answering these questions. Prelabs are part of a flipped classroom model where you are responsible for studying and learning the majority of the easier to understand material so that we can focus on the more difficult concepts during the lecture time that is available. Prelabs are NOT collaborative assignments; they are to be done individually. Academic plagiarism policies apply and are enforced. Concepts The purpose of this lab is to expand your experience with writing Java source code. In this lab we will again implement some of the basic elements of class definitions: fields and methods. We will expand our knowledge of Java statement syntax and introduce the conditional control structure (if statements). We will also implement Accessor and Mutator methods for a field as part of this lab. Additionally, this lab continues your exploration of the BlueJ environment, BlueJ’s editor, and gives you more experience with the object workbench. Background Read the remainder of chapter 2 in your text, and work through several of the exercises in the chapter to practice the concepts. Use the online tutorials (refer to the class web site) to get any further clarifications that you may need after reading the chapter material and doing some of the practice exercises. Assignment Instructions 1. Open the book-exercise project from chapter02 in the BlueJ projects file. You will use this file to complete this pre-lab. 2. Complete Exercises 2.83 – 2.91 on pages 59 – 61. Make sure to compile and test your code after each exercise. Western Oregon University Page 2 of 2 CS-161 Pre-Lab #3 3. Write at least 3 questions about concepts you do not understand after completing this lab and bring them to class on Monday. Optional Challenge Exercise: Complete exercise 2.92 and/or 2.93. These exercises are to be used to strengthen your skill level. There is no extra credit given in this class. Submission Instructions Submit in this prelab via Moodle using the “PreLab #” link. Your assignment MUST be uploaded by the assignment due date and time (see Moodle for the time), no exceptions or extensions of time are given. Partial credit is given, so submit however much of the prelab that you have completed by the due time otherwise both the prelab and lab will receive a 0 grade for the week. Moodle will automatically close the link at that time. It is highly recommend you do not wait until the very last minute to submit your work. ALL PRE-LABS are to be submitted as a SINGLE document in PDF format. Most modern word processors can now generate a PDF file or you can download free utilities to do the conversion (CutePDF for pc’s). Any submissions in any other format will not be graded and will not receive credit. Type your answers when appropriate, or if diagrams are needed you may scan them or take a picture and then paste the picture into the document. For coding questions, take one or more screen shots that show the code that you modified or created; and take screen shots of the run of your programs showing the outputs. Paste anything into your document that demonstrates your investigation and work on each of the questions. In your submission, please mark each of your answers/investigation with the question number clearly shown. Order the questions/answers in your PDF document in the same order that they are assigned in the prelab. If you do not do this, you may not get credit for some of your work.