Solved

The Class Ticket Has Been Coded as Follows

Question 38

Essay

The class Ticket has been coded as follows. Code the toString method so it returns the service and price separated by a : (colon) as in the following examples:
Example 1: B:34.99
Example 2: A:94.99
Example 3: B:44.99
public class Ticket
{
private double price;
private char service;
public Ticket( double newPrice, char newService )
{
setPrice( newPrice );
setService( newService );
}
}

Correct Answer:

verifed

Verified

public String toStri...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions