Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Only code implementations in Java please. 10.1 Credit worthiness The application is about companies and customers, who produce, buy and sell products. Parties involved can

image text in transcribedimage text in transcribed

Only code implementations in Java please.

10.1 Credit worthiness The application is about companies and customers, who produce, buy and sell products. Parties involved can have a credit rating. Define an enum for credit rating, which can have the values IRON, BRONZE, SILVER, GOLD and PLATINUM. 10.2 Products Products are the things being created and sold. The signature of the class Product is: public class Product \{ String name; String description; int productionPricePerUnit; // in eurocents List ingredients; public boolean addIngredient(Product product) \{ \} public boolean removelngredient(Product product) \{ \} public int getPrice() \{ \} Besides the methods given, the class has accessor methods, constructors, toString, equals, hashcode and maybe Comparable. I will not mention this all the time; from now on, it is assumed you know and add them. I also do not tell you the correct level of encapsulation, you can add this as is best. The method getPrice is a special one. As you can see, a product keeps a list of ingredients, which are products themselves. The price is calculated by adding the price of all ingredients on top of the productionPricePerUnit. Implement this class. Some products also have a price per unit. We call those Ingredients. Implement a class Ingredient. 10.3 Addresses Addresses will be relevant. An address has the following attributes: String street; int housenumber; String houseExtra; String zipcode; String muncipality; String country; Implement this class. 10.4 Orders An order is when one party buys and one party sells. The attributes of an order are: private final int orderld; private final IBuyer buyer; private final ISeller seller; private final Product product; private final LocalDate date; private final int price; Implement this class. 10.5 Being able to buy and sell There will be buyers and sellers. As it is not clear who can buy and sell, we want to have this flexible. Define two interfaces. IBuyer has as a signature: boolean buy(Product product, ISeller seller, int price); boolean buy(Order order); ISeller has as the signature: boolean sell(Product product, IBuyer buyer, int price); boolean sell(Order order); Define the interfaces

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_2

Step: 3

blur-text-image_3

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

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students explore these related Databases questions

Question

Patterns of Unemployment

Answered: 3 weeks ago