1.Questions 1 - 10 uses the following Class Diagram: CouponForPizza data fields
ID: 3724456 • Letter: 1
Question
1.Questions 1 - 10 uses the following Class Diagram:
CouponForPizza data fields are preceded by tildes ~ .
getArea method for Shape class is in italics.
Which of the following would be the class declaration for Shape?
public class Shape { …}
public abstract Shape { … }
public final Shape {… }
class Shape {….}
1 points
QUESTION 2
Which of the following would be the declaration for the name data field within the Shape class ?
private String name;
abstract String name;
String name;
protected String name;
1 points
QUESTION 3
Which of the following would be the correct declaration for totalCoupons with the Coupon class ?
private int totalCoupons;
private double totalCoupons;
public static int totalCoupons;
private static int totalCoupons = 0;
1 points
QUESTION 4
Which would be the correct method header for getArea within the Shape class ?
public double getArea();
public static double getArea();
public abstract double getArea();
public double getArea() = 0;
1 points
QUESTION 5
Which class has public data fields?
Order
Pizza
Customer
Coupon
1 points
QUESTION 6
Which of the following best describes the association between Pizza and Shape?
It is a 1-to-1 relationship
It is a many-to-one relationship
Pizza is contained within Shape
Shape is contained within Pizza
Both b and d are true
1 points
QUESTION 7
Which class has a static method?
Customer
Order
Pizza
Coupon
1 points
QUESTION 8
What is the relationship between Circle and Shape ?
Aggregation
Many-to-Many
Composition
Generalization
1 points
QUESTION 9
What type of class is CouponForPizza?
Aggregation
Composition
Association
Generalization
1 points
QUESTION 10
How many classes have package datafields?
0
1
2
3
a.public class Shape { …}
b.public abstract Shape { … }
c.public final Shape {… }
d.class Shape {….}
Customer Oide Pizza cL.pnce Real [1] ·shape:Shape pl E name String /1 . Phonelinber Integer 111 ardedD:Integer Circle -radius Rell Q " heightouble [1] -CouponExplanation / Answer
1. Which of the following would be the class declaration for Shape?
Correct option: b.public abstract Shape { … }
Explanation: getArea method for Shape class is in italics. Italic represent abstract; class which has abstract method in it is an abstract class.
2. Which of the following would be the declaration for the name data field within the Shape class ?
Correct option: d. protected String name;
Explanation: # notation represent protected ; before variable name there is # in UML diagram so it should be protected.
3. Which of the following would be the correct declaration for totalCoupons with the Coupon class ?
Correct option: d. private static int totalCoupons = 0;
Explanation: - notation is for private, and underline denotes static so the d is the correct option here.
4. Which would be the correct method header for getArea within the Shape class ?
Correct option: c. public abstract double getArea();
Explanation: getArea method for Shape class is in italics. Italic represent abstract;
5. Which class has public data fields?
Correct option: d. Coupon
Explanation: + sign represents public; in coupon class there is a public field: amount.
According to CHEGG policy 4 part questions should be answered ; I have answered 5 here. Please post another question to get the rest. Thank you mate.
/*Hope this helps. Thank you.*/
/*If this helps you, please let me know by giving a positive thumbs up. In case you have any queries, do let me know. I will revert back to you. Thank you!!*/
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.