Question: DIAGRAM Question 1: Code the following classes. Create a constructor in Toy to set the name and price. Car should have a constructor to

DIAGRAM Question 1: Code the following classes. Create a constructor in Toy to set the name and price. Car should have a constructor to set the name, price, color and speed. Doll should have constructor to set the name, price, dressColor and hair color. -name: String -price: double Toy Doll -dressColor: String -hairColor: String +getDressColor(): String +setDressColor(dressColor: String) +getHairColor(): String +setHairColor(dressColor: String) +getName(): String +setName(name: String) +getPrice(): double +setPrice(price: double) -color: String Car -speed: int +getColor(): String +setColor(dressColor: String) +getSpeed(): int +setSpeed(speed: int) DIAGRAM Question 2: Code the following classes. Create a constructor for Toy, Canvas and Doll. Toy Paintable howToPaint() price: int Canvas Doll size() walk()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
