ality java - Eclipse Bun yvindow Help Quick Access) : \" 0 labSjava elephant,jav
ID: 3743879 • Letter: A
Question
ality java - Eclipse Bun yvindow Help Quick Access) : " 0 labSjava elephant,java Elephant,jwa Scorable.class Player.class TeamTest.class Teamja Locality java 10 public class Locality 12 Create a new instance of this class with the given name and local sales tax rate. 13 14 paran locality Name of this locality to be stored 15 paran countyRate The local sales tax to which we will add the 8.04 (43) NY state sales tax 16 17 public Locality(String locality, double countyRate) 187 TOOO: Since we are in New York, add 0.04 to the county rate to storinge the overall tax 19 ratel 20) 21 23 Compute how much the current county would demand in taxes for purchasing a given item 25paran price Cost of the item whose state sales tax need to be calculated. 26 eturn Sales tax that must be added to a purchase of a given item public double calculateTax(double pcice) 29 30 31 32 Returns the tax rate for purchases in this locality (e.g., including both the locality and state sales taxes). 34 35 36 ·@return Tax rate for purchases in this locality. This tax rate should be expressed in decinal (nor percentage) form. a3 public double getTaxRate) 38 39 40 1 Get the nane of this county 42 43 return What name the county goes by 5 publie String getane D Console No consoles to display at this time. Smart Insert 29:4 21:18 2018/9y6Explanation / Answer
public class Locality { private String name; private double taxRate; public Locality(String locality, double countyRate) { this.name = locality; this.taxRate = countyRate + 0.04; } public double calculateTax(double price) { return taxRate * price; } public String getName() { return name; } public double getTaxRate() { return taxRate; } public void setName(String name) { this.name = name; } public void setTaxRate(double taxRate) { this.taxRate = taxRate; } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.