Implement association relationship between classes using C++/Java

1. Suppose you are designing a system to track the inventory of a retail store. The system should allow store employees to manage the inventory, including adding and removing items, and tracking sales. You need to create an association relationship between the Item class and the Sale class to represent the fact that each sale involves one or more items. Based on this scenario, which of the following association relationships should be used?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

2. The signatures of some constructors and methods that could be defined for a Restaurant class, a class intended to store information about a restaurant is shown in each question below. Show the statement used to call the methods. If the method or constructor returns a value then put the call on the right hand side of an assignment statement so that the returned result is saved in a variable. For the purposes of this question, you can assume that the following variables have been declared and initialized, if necessary: Restaurant restaurant; String restName; String restAddress; String menu; Person restOwner; String ownerName; String[] dessertList; Do not provide an implementation for these methods. Note: write only one method invocation statement per question below.
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

3. Which of the following best describes the type of association between the given classes, based on their relationships in a car rental reservation system? Classes: Customer, Vehicle, Reservation, Office Executive
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

4. If you are designing a system for managing different types of vehicles. You have a Vehicle abstract class with an abstract method startEngine(). You need to create a Car class that fully implements the startEngine() method and can be instantiated. Which of the following best describes the Car class in this scenario?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

5. You are building a drawing application where users can create various shapes like circles, rectangles, and triangles. You have an abstract class Shape with a method calculateArea(). You want to create a Circle class that can be used to represent a specific circle on the screen and calculate its area. To achieve this, how should the Circle class be defined in relation to Shape?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation