Help me fix the code And please help me write the @param for mealCost at line 28

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Help me fix the code And please help me write the @param for mealCost at line 28 Thank you
DUSnoourd | Grad... Yuzu Reader: Big.
Typing Practice O Online Cou
89
60
98
61
62
else if(serviceQuality==G00D_SERVICE)
CodeCheck
Reset
Download
63
t=0.2 mealCost;
64
65
else if(service@uality>=EXCELLENT SERVICE)
Testers
66
67
t=0.25 nealCost;
Running RestaurantBillTester.java
68
69
fail pass pass pass pass fall fail pass pass pass pass pass pass pass pass pass pass pass
return t;
70
RestaurantBill(Cost:50.95, Service:-1, Total:55.7265625)
Expected: RestaurantBill(Cost:50.95, Service:0, Total:58.2740625)
RestaurantBill(Cost:10.0, Service:3,Total:134.375)
Expected: RestaurantBill(Cost:100.0,Service:3, Total:134.375)
RestaurantBill(Cost:20.0,Service:2, Total: 25.875)
Expected: RestaurantBill(Cost:20.0, Service:2, Total.25.875)
RestaurantBill(Cost:10.0,Service:1,Total:11.9375)
Expected: RestaurantBill(Cost:10.0, Service:1, Total:11,9375)
RestaurantBill (Cost:10.0, Service:0,Total:11.4375)
Expected: RestaurantBill(Cost:10.0,Service:0, Total:11.4375)
RestaukantBill(Cost:78.19, Service:4,Total:105.0678125)
Expected: RestaurantBill(Cost:78.19, Service:3 Total:165.8678125)
71
* find thể tax
* @return tax
72
73
74
75
public double tax()
76
77
return mealCost TAX RATE;
78
79
80
* find the restaurant total bill cost
* @return the restaurant bill cost
81
82
83
public String tostring()
84
8.00
Expected: 2.55
25.00
Expected: 25.00
85
return RestaurantBill(Cost: nealCost +. Service: +serviceQuality +,Total: +(tip() + neal Cost + tax() +")");
86
87
88 }
89
4.00
Expected: 4.00
1.00
90
Expected: 1.00
0.59
Reset
Download
CodeCheck
Expected: 0.50
19.55
Expected: 19.55
4.78
Testers
Running RestaurantBilITester.java
Expected: 4.78
9.38
Expected: 9.38
1.88
Eroacted1
fall pass pass pass pass fail fail pass pass pass pass pass pass pass pass pass pass pass
RestaurantBill(Cost:50.95,Service:-1, Total:55.7265625)
Expected: RestaurantBill(Cost:50,95,Service:0,Total:58.2740625)
RestaurantBill (Cost:100.0.Service:3,Total:134.375)
MacBook
Transcribed Image Text:DUSnoourd | Grad... Yuzu Reader: Big. Typing Practice O Online Cou 89 60 98 61 62 else if(serviceQuality==G00D_SERVICE) CodeCheck Reset Download 63 t=0.2 mealCost; 64 65 else if(service@uality>=EXCELLENT SERVICE) Testers 66 67 t=0.25 nealCost; Running RestaurantBillTester.java 68 69 fail pass pass pass pass fall fail pass pass pass pass pass pass pass pass pass pass pass return t; 70 RestaurantBill(Cost:50.95, Service:-1, Total:55.7265625) Expected: RestaurantBill(Cost:50.95, Service:0, Total:58.2740625) RestaurantBill(Cost:10.0, Service:3,Total:134.375) Expected: RestaurantBill(Cost:100.0,Service:3, Total:134.375) RestaurantBill(Cost:20.0,Service:2, Total: 25.875) Expected: RestaurantBill(Cost:20.0, Service:2, Total.25.875) RestaurantBill(Cost:10.0,Service:1,Total:11.9375) Expected: RestaurantBill(Cost:10.0, Service:1, Total:11,9375) RestaurantBill (Cost:10.0, Service:0,Total:11.4375) Expected: RestaurantBill(Cost:10.0,Service:0, Total:11.4375) RestaukantBill(Cost:78.19, Service:4,Total:105.0678125) Expected: RestaurantBill(Cost:78.19, Service:3 Total:165.8678125) 71 * find thể tax * @return tax 72 73 74 75 public double tax() 76 77 return mealCost TAX RATE; 78 79 80 * find the restaurant total bill cost * @return the restaurant bill cost 81 82 83 public String tostring() 84 8.00 Expected: 2.55 25.00 Expected: 25.00 85 return RestaurantBill(Cost: nealCost +. Service: +serviceQuality +,Total: +(tip() + neal Cost + tax() +")"); 86 87 88 } 89 4.00 Expected: 4.00 1.00 90 Expected: 1.00 0.59 Reset Download CodeCheck Expected: 0.50 19.55 Expected: 19.55 4.78 Testers Running RestaurantBilITester.java Expected: 4.78 9.38 Expected: 9.38 1.88 Eroacted1 fall pass pass pass pass fail fail pass pass pass pass pass pass pass pass pass pass pass RestaurantBill(Cost:50.95,Service:-1, Total:55.7265625) Expected: RestaurantBill(Cost:50,95,Service:0,Total:58.2740625) RestaurantBill (Cost:100.0.Service:3,Total:134.375) MacBook
32
8 public class RestaurantBill
9 {
public static final int EXCELLENT SERVICE = 3;
11
public RestaurantBill(double nealCost, int serviceQuality)
34
{
10
35
if (mealCost < MIN COST)
public static final int GOOD SERVICE = 2;
public static final int FAIR SERVICE = 1;
public static final int POOR SERVICE = 0;
36
12
37
this mealCost = MIN COST;
13
38
14
39
else
public static final double MIN COST = 10.0;
public static final double TAX RATE = (9.375 /100);
public static final double EXCELLENT_TIP = (25.0/180);
18
15
40
%3D
16
41
this.nealCost= nealCost;
17
42
%3D
public static final double GOOD_TIP = (20.0/100);
public static final double POOR_TIP = (5.0/100);
public static final double FAIR_TIP = (10.0/100);
43
19
44
this.serviceQuality = serviceQuality;
%3D
20
45
21
46
private double mealCost;
23
22
find the tip of the service
* ereturn the tip anount
47
private int serviceQuality;
private double tax;
25
48
24
49
50
public double tip()
26 **
27* get the mealcost and service
28 GParam mealCost with if leargest then MIN Cost and else for mealCost equal to MIN Cost
29 eparam serviceQuality with else
30 /
51
52
double t=0;
53
if(serviceQuality==P00R SERVICE)
55
t=9.05ªnealCost;
31
56
32
57
else if(serviceQuality==FAIR SERVICE)
public RestaurantBill(double mealCost, int serviceQuality)
34
33
58
59
t=0.1'neal.Cost;
35
if (mealCost < MIN_COST)
36
this.nealCost = MIN_ COST;
61
else if(serviceQuality=GO00 SERVICE)
37
62
38
63
t=0.2*nealCost;
39
else
64
40
this.meal Coste nealCost;
65
else if(serviceQuality>=EXCELLENT_SERVICE)
41
42
66
43
67
t-0.25*nealCost;
44
68
this.serviceQuality = serviceQuality;
}
45
69
return t;
46
**
70
71
/**
MacBook
Transcribed Image Text:32 8 public class RestaurantBill 9 { public static final int EXCELLENT SERVICE = 3; 11 public RestaurantBill(double nealCost, int serviceQuality) 34 { 10 35 if (mealCost < MIN COST) public static final int GOOD SERVICE = 2; public static final int FAIR SERVICE = 1; public static final int POOR SERVICE = 0; 36 12 37 this mealCost = MIN COST; 13 38 14 39 else public static final double MIN COST = 10.0; public static final double TAX RATE = (9.375 /100); public static final double EXCELLENT_TIP = (25.0/180); 18 15 40 %3D 16 41 this.nealCost= nealCost; 17 42 %3D public static final double GOOD_TIP = (20.0/100); public static final double POOR_TIP = (5.0/100); public static final double FAIR_TIP = (10.0/100); 43 19 44 this.serviceQuality = serviceQuality; %3D 20 45 21 46 private double mealCost; 23 22 find the tip of the service * ereturn the tip anount 47 private int serviceQuality; private double tax; 25 48 24 49 50 public double tip() 26 ** 27* get the mealcost and service 28 GParam mealCost with if leargest then MIN Cost and else for mealCost equal to MIN Cost 29 eparam serviceQuality with else 30 / 51 52 double t=0; 53 if(serviceQuality==P00R SERVICE) 55 t=9.05ªnealCost; 31 56 32 57 else if(serviceQuality==FAIR SERVICE) public RestaurantBill(double mealCost, int serviceQuality) 34 33 58 59 t=0.1'neal.Cost; 35 if (mealCost < MIN_COST) 36 this.nealCost = MIN_ COST; 61 else if(serviceQuality=GO00 SERVICE) 37 62 38 63 t=0.2*nealCost; 39 else 64 40 this.meal Coste nealCost; 65 else if(serviceQuality>=EXCELLENT_SERVICE) 41 42 66 43 67 t-0.25*nealCost; 44 68 this.serviceQuality = serviceQuality; } 45 69 return t; 46 ** 70 71 /** MacBook
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY