Tap-Cengage Learning × https://ng.cengage.com/static/nb/ui/evo/index.html ntld-5
ID: 3751238 • Letter: T
Question
Tap-Cengage Learning × https://ng.cengage.com/static/nb/ui/evo/index.html ntld-5847112228561158096560901412&elSBN MINDTAP Frum Cengage ramming Exercise 10-3 Instructions CustomTee java i DemoTees,java TeeShirt,java + 1 public class CustonTee extends TeeShirt Create a include Teeshurt class for Toby's Tee Shirt Company. Fields 3 prtvate String slogan; 4 public votd setslogan(String slgn) orderNumber - of type int . size - of type String // wrtte your code here color -of type string 8 public String getSlogan() price of type double Create set methods for the order number, size, and color and get methods for all four fields. The price is determined by the 1Il write your code here 12 size: $22.99 for XXL or xXXXL, and $19.99 for all other sizes. Create a subclass named CustonTee that descends from TeeShirt and includes a field named slogan (of type string ) to hold the slogan requested for the shirt, and include get and set methods for this field. Grading Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks bytton will run pre-configured tests against your code toExplanation / Answer
Please find the code below.
TeeShirt.java
************************
public class TeeShirt {
private int orderNumber;
private String size, color;
private double price;
/**
* @return the orderNumber
*/
public int getOrderNumber() {
return orderNumber;
}
/**
* @param orderNumber the orderNumber to set
*/
public void setOrderNumber(int orderNumber) {
this.orderNumber = orderNumber;
}
/**
* @return the size
*/
public String getSize() {
return size;
}
/**
* @param size the size to set
*/
public void setSize(String size) {
this.size = size;
}
/**
* @return the color
*/
public String getColor() {
return color;
}
/**
* @param color the color to set
*/
public void setColor(String color) {
this.color = color;
}
/**
* @return the price
*/
public double getPrice() {
return (size.equalsIgnoreCase("XXL") || size.equalsIgnoreCase("XXXL")) ? 22.99 : 19.99;
}
}
CustomTee.java
************************
public class CustomTee extends TeeShirt {
private String slogan;
/**
* @return the slogan
*/
public String getSlogan() {
return slogan;
}
/**
* @param slogan the slogan to set
*/
public void setSlogan(String slogan) {
this.slogan = slogan;
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.