Question
1) Consider an object called space shuttle. Among the following, select what would describe the state of the object, and what would be a behavior
1) Consider an object called space shuttle. Among the following, select what would describe the state of the object, and what would be a behavior of the object.
a. The speed of the shuttle when reentering the Earth atmosphere.
b. The maximum payload that the shuttle can carry.
c. The act of docking the shuttle to the international space station.
d. The act of starting the shuttle engine.
2) For each of the objects listed below, give the name of a class that this object could be an instance of. Name the class following the Java style guidelines. Example: for the object a cell phone, a possible class name could be CommunicationDevice. Dont just restate the name of the object for the name of the class (e.g. CellPhone).
a. A pair of glasses
b. A wallet
c. A movie theater
d. A Walmart store
e. A subtraction such as 8 2 = 6 f. A novel
3) Draw the class diagram for the following class:
public class Dog {
private String name;
private int age;
public Dog(String n, int a) {
// code }
public void bark() {
//code }
public boolean eat(String food) {
// code
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started