Examlex

Solved

The Class Ticket Has Been Coded as Follows

question 54

Short Answer

The class Ticket has been coded as follows:
public class Ticket
{
private double price;
private char service;
public Ticket( double newPrice, char newService )
{
setPrice( newPrice );
setService( newService );
}
}
In a client class and inside the main method, myTicket is an object reference of type Ticket. Call the method tax with myTicket, assuming a tax rate of 0.06, and assign the resulting tax value to a variable named myTax.
float taxRate = 0.06f;
// Your code goes here


Definitions:

Market System

An economic system in which decisions regarding investment, production, and distribution are guided by the price signals created by the forces of supply and demand.

Property Rights

Legal rights to possess, use, and dispose of assets including real property (land and buildings) and intellectual property.

Public Policy

Government actions, laws, and regulations that reflect the attitudes and rules for the public implemented by different levels of government.

Environmental Concerns

Issues related to the protection of the natural environment due to impacts from human activity, often requiring policy and individual actions to address.

Related Questions