Question: Using BlueJ to solve questions Answer all question, Each question carries 5 Marks Q 1 . A ) Create a class, AirConditioner, that contains a

Using BlueJ to solve questions
Answer all question, Each question carries 5 Marks
Q1. A) Create a class, AirConditioner, that contains a single field temperature of type double.
B) Define a constructor that takes no parameters. The temperature field should be set to
the value 18.0 in the constructor.
C) Define the mutator method changeTemperature() whose effect is to increase or
decrease the value of temperature by 3.0 respectively.
D) Define an accessor method display(0) to return the value of temperature.
E) Create objects of the AirConditioner class and call the methods you created.
Q2. Write a java programing to do the following:
A) Create an ArrayList object called items that will store String elements. Add 4 items to
the ArrayList and iterate over the collection.
B) Create a HashMap object called Books that will store String keys and Integer values.
Add 3 books(bookname and bookprice) to the HashMap.Using BlueJ to solve questions
Using BlueJ to solve questions Answer all

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!