Create a class called vehicle

Assignment Help C/C++ Programming
Reference no: EM13333459

Create a class called Vehicle that has the manufacturer's name (type String), number of cylinders in the engine (type int), and owner (type Person given below). Then, create a class called Truck that is derived from Vehicle and has the following additional properties:

The load capacity in tons (type double since it may contain fractional part) and towing capacity in RM (type int). Be sure your class has a reasonable complement of constructors, accessor and mutator methods, and suitably defined equals and toString methods. Write a program to test all your methods.

The definition of the class Person is below. Completing the definitions of the methods is part of this exercise.

public class Person
{
private String name;
public Person()
{...}
public Person (String theName)
{...}
public String getName()
{...}
public void setName (String theName)
{...}
public String toString()
{...}
public Boolean equals(Object other)
{...}


}

 

Reference no: EM13333459

Questions Cloud

Determine the acceleration of the hanging weight : A wheel rotates about a horizontal axis. It has an outer radius R1 = 18.8 cm and mass M1 = 5.12 kg. What is the acceleration of the hanging weight after it is released
Write an interactive program that prompts for a desired sum : Write an interactive program that prompts for a desired sum, then repeatedly rolls two six-sided dice until their sum is the desired sum. Here is the expected dialogue with the user.
Is it a violation of the canons of ethics for an attorney : Is it a violation of the Canons of Ethics for an attorney, who is engaged in the practice of criminal and civil law to be engaged in the business of making bail bonds under an assumed company name and to advertise such business in the telephone di..
Define a class for file that is derived from document : Similarly, define a class for File that is derived from Document and includes a instance variable for the pathname. The textual contents of the file should be stored in the inherited variable text. Redefine the toString method to concatenate all t..
Create a class called vehicle : Create a class called Vehicle that has the manufacturer's name (type String), number of cylinders in the engine (type int), and owner (type Person given below).
Determine the risk-free rate according to capm : the return on the market portfolio is currently 12%. mobile phone corporation stockholders require a rate of return of 30% and the stock has a beta of 3.2. according to capm, DETERMINE THE RISK-FREE RATE.
Calculate the new angular speed of the student : A student sits on a rotating stool holding two 3.6-kg objects. When his arms are extended horizontally, Find the new angular speed of the student
Define a class named creditcardpayment : Create a main method that creates at least two CashPayment and two CreditCardPayment objects with different values and calls payment Details for each.
Consulting the attorney of record : 1. Is it in violation of the Canons of Ethics for an attorney being a member of a district attorney's staff to attempt to elicit a confession or statement from a defendant charged with the criminal offense without consulting the attorney of recor..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd