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

  1. Create a class Watch with the following attributes model

    1. brand

    2. release year

    3. price

    4. is it a smartwatch

    5. is it waterproof

  2. Create a constructor for the given class

  3. Create a method that will calculate the total profit the watch made, given the number of units sold as input.

  4. 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.

  5. 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.

  6. Create 2 unit tests for all the methods (one positive assertion and one negative assertion).

  7. Make sure that the profit tests are run first, followed by the overpriced watch tests and then best-value watch tests

  8. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!