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

  Businesspartner class that contains a first name

Create a BusinessPartner class that contains a first name, company name, and a telephone number. Create a Contacts class that contains a dynamically allocated array of BusinessPartners as well as the owner's name and cell phone number.

  The function should accept the future value

The function should accept the future value, annual interest rate, and number of years as arguments. It should return the present value, which is the amount that you need to deposit today. Demonstrate the function in a program that lets the user expe..

  Write c++ program that reads in the average monthly rainfall

Write a C++ program that reads in the average monthly rainfall for a city for each month of the year and then reads in the actual monthly rainfall for each of the previous 12 months

  Static field holds total winnings for all horses in stable

static field holds total winnings for all horses in the stable // total winnings are shown after each horse wins,

  Concept of object-oriented programming

Determine the manner in which each of the provided concepts relates to the concept of object-oriented programming. Justify your response - Analyze the fundamental manner in which they each relate to C++ coding of programs.

  Uml diagram of all the classes

Speaking of converting into the correct object-type, the goal of the factory is to abstract away object creation.

  Write program which prompts user to enter numbers

Write down the program which prompts the user to enter numbers, findsout how many positive and negative values have been entered, and calculates sum and average of numbers entered.

  Afunction that raises an integer to a positive integer

Write a function that raises an integer to a positive integer power. Call the function x_to_the_n, taking two integer arguments x and n.

  Convert celsius temperatures to fahrenheit temperatures

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

  Returns a count of the steps through the sort

Please write a c++ implimentation that returns a count of the steps through the sort. (do not worry about updating count, I will rewrite that segemnt. I need help with writing the shell sort.

  Calculates the average of three test scores

Write a program that calculates the average of three test scores. The program should contain three value-returning functions: main, getTestScore, and calcAverage

  Write a program in which set up a douhly-subscripted array

Write a program in which you set up a douhly-subscripted array to store each character in the wit. Ube ;old loops, and the most efficient  statements to do it. Include documentation (comment stmts.) in your program.

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