Question: Implement and test a class for watches , based on the following guidelines Create a class Watch with the following attributes model brand release year
Implement and test a class for watches, based on the following guidelines
-
Create a class Watch with the following attributes model
-
brand
-
release year
-
price
-
is it a smartwatch
-
is it waterproof
-
-
Create a constructor for the given class
-
Create a method that will calculate the total profit the watch made, given the number of units sold as input.
-
Create a method that checks if a watch is a best-value watch. Best-value watches are smartwatches, waterproof and cost no more than 400 dollars.
-
Write a method to check if a watch is overpriced. A watch is overpriced if it was made before 2010, and costs more than 500 dollars.
-
Create 2 unit tests for all the methods (one positive assertion and one negative assertion).
-
Make sure that the profit tests are run first, followed by the overpriced watch tests and then best-value watch tests
-
Create a CSV file to test which of the given watches are overpriced. Add at least two watches to the CSV file (you can use any data values for the watches).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
