Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

provide a java code to pass the below test cases; @Test public void test _ 7 _ 0 ( ) { RideRequest request = new

provide a java code to pass the below test cases; @Test
public void test_7_0(){
RideRequest request = new RideRequest(" Kate , Woodbine ,35.25, Y ");
RideRequest.setTaxrate(0.1); // Assuming 10% tax rate
RideRequest.setDiscount(0.2); // Assuming 20% discount rate
String expectedOutput ="1. Kate |Woodbine |38.78|31.02";
assertEquals("toString method failed", expectedOutput, request.toString());
}
@Test
public void test_7_1(){
RideRequest request = new RideRequest(" Susan ,Mississauga ,7.99, Y ");
RideRequest.setTaxrate(0.1); // Assuming 10% tax rate
RideRequest.setDiscount(0.2); // Assuming 20% discount rate
String expectedOutput ="2. Susan |Mississauga |8.79|7.03";
assertEquals("toString method failed", expectedOutput, request.toString());
}
@Test
public void test_7_2(){
RideRequest request = new RideRequest(" Jack , North York ,9.99, Y ");
RideRequest.setTaxrate(0.15); // Assuming 15% tax rate
RideRequest.setDiscount(0.25); // Assuming 25% discount rate
String expectedOutput ="3. Jack |North York |11.49|8.62";
assertEquals("toString method failed", expectedOutput, request.toString());
}
@Test
public void test_7_3(){
RideRequest request = new RideRequest(" Jack , North York ,9.99, N ");
RideRequest.setTaxrate(0.15); // Assuming 15% tax rate
RideRequest.setDiscount(0.25); // Assuming 25% discount rate
String expectedOutput ="4. Jack |North York |11.49|";
assertEquals("toString method failed", expectedOutput, request.toString());
}
@Test
public void test_7_4(){
RideRequest request = new RideRequest(" Susan ,Mississauga ,7.99, N ");
RideRequest.setTaxrate(0.1); // Assuming 10% tax rate
RideRequest.setDiscount(0.2); // Assuming 20% discount rate
String expectedOutput ="5. Susan |Mississauga |8.79|";
assertEquals("toString method failed", expectedOutput, request.toString());
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

From Zero To Data Hero With Chatgpt

Authors: Andrew Wu

1st Edition

B0CQRJPXD9, 979-8989523009

More Books

Students also viewed these Databases questions

Question

(2) Determining the general form of the model. Pg45

Answered: 1 week ago