How to write the checking for if serviceQuality is too high or low in the constructor by in the information I grieved to you

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter4: Analyzing And Charting Financial Data
Section: Chapter Questions
Problem 4.6CP
icon
Related questions
Question
How to write the checking for if serviceQuality is too high or low in the constructor by in the information I grieved to you
28
29
this. mealCost MIN COST:
30
31
else
32
33
this.nealCoste neal Cost:
34
35
36
37
this.serviceQuality serviceQuality:
38
public double tip()
39
double t-0;
if(servicequalityumPOOR SERVICE)
40
41
42
43
t-0.05*mealCost;
44
45
else if(serviceQualitywaFAIR_SERVICE)
46
47
t-0.1ealCost;
48
49
else if(serviceQualityGO00 SERVICE)
50
51
t-0.2*neal Cost;
52
53
else if(serviceQualitysEXCELLENT SERVICE)
54
55
t0.25*nealCost:
56
57
return t:
58
public double tax()
59
60
61
return sealCost TAX RATE;
62
63
public String toString()
64
65
return"RestaurantBill(Costi+ nealCost ,Service:" serviceuality ,Total: +(tip() + sealCost + tax( +:
66
67 )
68
69
Transcribed Image Text:28 29 this. mealCost MIN COST: 30 31 else 32 33 this.nealCoste neal Cost: 34 35 36 37 this.serviceQuality serviceQuality: 38 public double tip() 39 double t-0; if(servicequalityumPOOR SERVICE) 40 41 42 43 t-0.05*mealCost; 44 45 else if(serviceQualitywaFAIR_SERVICE) 46 47 t-0.1ealCost; 48 49 else if(serviceQualityGO00 SERVICE) 50 51 t-0.2*neal Cost; 52 53 else if(serviceQualitysEXCELLENT SERVICE) 54 55 t0.25*nealCost: 56 57 return t: 58 public double tax() 59 60 61 return sealCost TAX RATE; 62 63 public String toString() 64 65 return"RestaurantBill(Costi+ nealCost ,Service:" serviceuality ,Total: +(tip() + sealCost + tax( +: 66 67 ) 68 69
*/
public class RestaurantBill
{
public static final int EXCELLENT SERVICE = 3;
public static final int GOOD SERVICE = 23;
public static final int FAIR SERVICE = 1;
public static final int POOR SERVICE
%3D
0;
public static final double MIN COST
public static final double TAX RATE = (9.375 / 100);
public static final double EXCELLENT TIP :
public static final double GOOD TIP = (20.0 / 100);
public static final double P0OR TIP
public static final double FAIR TIP
10.0;
(25.0 / 100);
(5.0 / 100);
(10.0 / 100);
Transcribed Image Text:*/ public class RestaurantBill { public static final int EXCELLENT SERVICE = 3; public static final int GOOD SERVICE = 23; public static final int FAIR SERVICE = 1; public static final int POOR SERVICE %3D 0; public static final double MIN COST public static final double TAX RATE = (9.375 / 100); public static final double EXCELLENT TIP : public static final double GOOD TIP = (20.0 / 100); public static final double P0OR TIP public static final double FAIR TIP 10.0; (25.0 / 100); (5.0 / 100); (10.0 / 100);
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Decision Making Process
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
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning