HTW Berlin Fachbereich 4 Internationaler Studiengang Internationale Medieninformatik (Bachelor) Info 1: Informatik I Summer Term 2014 |
Laboratory 0: Shapes and TicketMachine |
This week's lab work is intended to acquaint you with the BlueJ environment.
Pre-lab
Please bring these exercises printed out or written out with you to lab. Please have your name on your page.
P1. In the lecture we have talked about data types called int and String. Java has more predefined primitive data types. What are they? Record where you found this information.
P2. What are the types of the following values?
P3. Pick up a book – you should have at least one at home. Is it an object or a class? If it is a class, name some objects. If it is an object, name the class. Give your reasoning.
P4. What class does the following constructor belong to? How many formal parameters does it have? What are their types?
public Book (String title, double price)
If you will be using your own laptop in the lab, please install BlueJ before you come to lab. Downloads are available for all platforms - it's Java!
Lab assignments are due the night before your next lab at 22.00, I want you to get some sleep the night before Tuesday class. They may, of course, be turned in earlier. You hand them in by preparing the report in PDF and submitting it to Moodle.
Assignment
Shapes
Download the projects file from the Moodle room and open up the Shapes project.
public TicketMachine (int ticketCost) { int price = ticketCost; balance = 0; total = 0; }
Writeup
You will be doing your writeup at home. Use the notes that you took in your logbook. Submit your writeup as your post-lab to the Moodle area.