1. Inside model package create a class and call it Shipment with four attributes customerld (String), shippingAddress (String), weight (double), shippingRate(double). 2. Write a no-argument constructor. Set the default shipping rate to 10QR/kg. 3. Write a three-argument constructor for (customerld, shippingAddress, weight). You should call the no-arguemnt constructor to set the default value of the shipping rate. 4. Write a fully parameterized constructor for the four attributes. You should use the previous constructor for the first three arguments. 5. Generate setters and getters for all attributes: a. You should ensure weight will never be negative everywhere b. shippingRate must be greater than 0 and less than 40, otherwise set it to 10. 6. Write a method called getShipmentPrice(). The method should set 30 OR for the first 1kg and (shippingRate weight) for every extra kg. 7. Create another class called ShipmentTest with a main method to test your class: a. Create 2 shipment objects: i. For the first one, use the no-argument constructor. Set the weight of the object using the setter to 3.45. ii. For the second one, use the fully parametrized constructor. Set the shipping
1. Inside model package create a class and call it Shipment with four attributes customerld (String), shippingAddress (String), weight (double), shippingRate(double). 2. Write a no-argument constructor. Set the default shipping rate to 10QR/kg. 3. Write a three-argument constructor for (customerld, shippingAddress, weight). You should call the no-arguemnt constructor to set the default value of the shipping rate. 4. Write a fully parameterized constructor for the four attributes. You should use the previous constructor for the first three arguments. 5. Generate setters and getters for all attributes: a. You should ensure weight will never be negative everywhere b. shippingRate must be greater than 0 and less than 40, otherwise set it to 10. 6. Write a method called getShipmentPrice(). The method should set 30 OR for the first 1kg and (shippingRate weight) for every extra kg. 7. Create another class called ShipmentTest with a main method to test your class: a. Create 2 shipment objects: i. For the first one, use the no-argument constructor. Set the weight of the object using the setter to 3.45. ii. For the second one, use the fully parametrized constructor. Set the shipping
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Please do not copy from chegg. It is wrong.
![Inside the project
1. Inside model package create a class and call it Shipment with four attributes customerld
(String), shippingAddress (String), weight (double), shippingRate(double).
2. Write a no-argument constructor. Set the default shipping rate to 1OQR/kg.
3. Write a three-argument constructor for (customerld, shippingAddress, weight). You should call
the no-arguemnt constructor to set the default value of the shipping rate.
4. Write a fully parameterized constructor for the four attributes. You should use the previous
constructor for the first three arguments.
5. Generate setters and getters for all attributes:
a. You should ensure weight will never be negative everywhere
b. shippingRate must be greater than 0 and less than 40, otherwise set it to 10.
6. Write a method called getShipmentPrice(). The method should set 30 OR for the first 1kg and
(shippingRate * weight) for every extra kg.
7. Create another class called ShipmentTest with a main method to test your class:
a. Create 2 shipment objects:
i. For the first one, use the no-argument constructor. Set the weight of the object
using the setter to 3.45.
ii. For the second one, use the fully parametrized constructor. Set the shipping
rate to 20 and the weight to 1.5.
b. Print out the shipment price of both objects as shown in the sample output.
Sample output:
Shipping price for shipemnt of weight 3.45 kg is 54.50 QAR
Shipping price for shipemnt of weight 1.50 kg is 40.00 QAR](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F15fb1e08-ee7d-4c7c-9122-e4ba9777b568%2F08e0f51b-9d91-48ac-93ff-8b9200129dad%2Fplgfzyt_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Inside the project
1. Inside model package create a class and call it Shipment with four attributes customerld
(String), shippingAddress (String), weight (double), shippingRate(double).
2. Write a no-argument constructor. Set the default shipping rate to 1OQR/kg.
3. Write a three-argument constructor for (customerld, shippingAddress, weight). You should call
the no-arguemnt constructor to set the default value of the shipping rate.
4. Write a fully parameterized constructor for the four attributes. You should use the previous
constructor for the first three arguments.
5. Generate setters and getters for all attributes:
a. You should ensure weight will never be negative everywhere
b. shippingRate must be greater than 0 and less than 40, otherwise set it to 10.
6. Write a method called getShipmentPrice(). The method should set 30 OR for the first 1kg and
(shippingRate * weight) for every extra kg.
7. Create another class called ShipmentTest with a main method to test your class:
a. Create 2 shipment objects:
i. For the first one, use the no-argument constructor. Set the weight of the object
using the setter to 3.45.
ii. For the second one, use the fully parametrized constructor. Set the shipping
rate to 20 and the weight to 1.5.
b. Print out the shipment price of both objects as shown in the sample output.
Sample output:
Shipping price for shipemnt of weight 3.45 kg is 54.50 QAR
Shipping price for shipemnt of weight 1.50 kg is 40.00 QAR
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY