Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Product and Store: Class 1 : Product Attributes; productName, price, stockCount Methods: buyProduct ( int count ) , getProductDetails ( ) Class 2 : Store

Product and Store:
Class 1: Product
Attributes; productName, price, stockCount
Methods: buyProduct(int count), getProductDetails()
Class 2: Store
Attributes: inventory
Methods: addProduct(Product product), sellProduct(String productName, int count), list Products 0
Goal: Design a simple store management system where products can be added, sold, and listed.
Instructions
Begin with the "Product' elass.
Define attributes: 'productName" "price", and "stockCount ",
Implement methods to buy a product and get product details.
Create the 'Store' class,
Define the attributes "inventory" (use an Array).
Create methods to add products, sell products, and list all products.
In the "main "method, demonstratte adding products to the store, selling products, and listing them.
Screenshots of Code and output:
5. Vehicle and Garage:
Class 1:Vehicle
Attributes: vehicleID, type, brand
Methods: getDetailsO, start0, stop0
Class 2: Garage
Attributes: listofVehicles
Methods: addVehicle(Vehicle vehicle), removeVehicle(String vehicleID), listallVehicles 0
Goul: Build'a garage system where vehicles can be added, removed, and listed.
Instructions:
Design the 'Vehicle' class.
Define attributes: "vehiciell'. "type', and 'brand "
Implement methods to get vehicle details, start, and stop the vehicle.
Construct the "Garage" class.
Define the attribute: "listorNehicles" (use an ArrayList).
Create methods to add vehicles, remove vehicles, and list all vehicles.
In the 'main' method, demonstrate adding vehictes to the garage, removing them, and listing all vehicles.
Sereenshots of Code and output:
In java please
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

How autonomous should the target be left after the merger deal?

Answered: 1 week ago