PART I: Given the following UML diagram. Answer the following questions Battery id: an integer to identify each battery. Name: a string of characters. Level: an integer to classify product quality (1,2,3) Year : an integer to show year of production Price: a double value for the price of the battery. Attributes Constructor. toString: to return information about a battery Provide set and get methods. • salePrice): computes a sale price by adding the proffit percentage depending on the quality as follows: 1. for qualtiy 1 add 13% to the price. 2. for qualtiy 2 add 16% to the price. 3. for qualtiy 3 add 19% to the price . batterydiscount (int Byear) method takes the current year and do a discounts 5% of the saleprice if the year of production is more than 2 years Methods Actira Question 1. Battery as well as the constructor and the setter antl getter of the Level and price. y. Implement all the data fields represented in the UML diagram of the class Note that: a. The constructor accepts all data fields. b. The method setL.evel(int L) assigns the value L to the Level attribute if the value not accepted ex: not 1, 2 or 3 set it to 1. c. The method getL.evel() returns the value of Level attribute. d. salePrice(): computes a sale price by adding the proffit percentage depending on the quality as follows: 1. for quality I add 13% to the price. 2. for quality 2 add 16% to the price. 3. for quality 3 add 19% to the price..

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
PART I: Given the following UML diagram. Answer the following questions
Battery
id: an integer to identify each battery.
Name: a string of characters.
Level: an integer to classify product quality (1,2,3)
Year : an integer to show year of production
Price: a double value for the price of the battery.
Attributes
Constructor.
toString: to return information about a battery
• Provide set and get methods.
• salelrice(): computes a sale price by adding the proffit
percentage depending on the quality as follows:
1. for qualtiy 1 add 13% to the price.
2. for qualtiy 2 add 16% to the price.
3. for qualtiy 3 add 19% to the price .
• batterydiscount (int Byear) method takes the current year
and do a discounts 5% of the saleprice if the year of
production is more than 2 years
Methods
Actira
Question 1.
Battery as well as the constructor and the setter antd getter of the Level and price.
y. Implement all the data fields represented in the UML diagram of the class
Note that:
a. The constructor accepts all data fields.
b. The method setL.evel(int L) assigns the value L to the Level attribute if the value not accepted
ex: not 1, 2 or 3 set it to 1.
c. The method getLevel() returns the value of Level attribute.
d. salePrice(): computes a sale price by adding the proffit percentage depending on the quality as
follows:
1. for quality I add 13% to the price.
2. for quality 2 add 16% to the price.
3. for quality 3 add 19% to the price .
Transcribed Image Text:PART I: Given the following UML diagram. Answer the following questions Battery id: an integer to identify each battery. Name: a string of characters. Level: an integer to classify product quality (1,2,3) Year : an integer to show year of production Price: a double value for the price of the battery. Attributes Constructor. toString: to return information about a battery • Provide set and get methods. • salelrice(): computes a sale price by adding the proffit percentage depending on the quality as follows: 1. for qualtiy 1 add 13% to the price. 2. for qualtiy 2 add 16% to the price. 3. for qualtiy 3 add 19% to the price . • batterydiscount (int Byear) method takes the current year and do a discounts 5% of the saleprice if the year of production is more than 2 years Methods Actira Question 1. Battery as well as the constructor and the setter antd getter of the Level and price. y. Implement all the data fields represented in the UML diagram of the class Note that: a. The constructor accepts all data fields. b. The method setL.evel(int L) assigns the value L to the Level attribute if the value not accepted ex: not 1, 2 or 3 set it to 1. c. The method getLevel() returns the value of Level attribute. d. salePrice(): computes a sale price by adding the proffit percentage depending on the quality as follows: 1. for quality I add 13% to the price. 2. for quality 2 add 16% to the price. 3. for quality 3 add 19% to the price .
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
System Model Approaches
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education