Add a member function to print out all the information

Assignment Help Computer Engineering
Reference no: EM132196945

Write a C++ program:

Write a class to contain the following information about towns: the name (a sequence of characters); the population (an integer); and a Boolean value (i.e. true or false) which indicates whether the town has an airport or not.

Make the three data members private. Include a constructor that initialises the data members.

And Now add three new member functions to the towns class that assign values to the three data members.

Also add a member function to print out all the information about a town. The member functions should all be publicly accessible.

Write a main() function which declares three town objects and assigns the following values to them:

Name: London Manchester Liverpool
Population: 1 000 000 50 000 35 000

Airport: True True False

After assigning values to the three objects, the program should print the details of thoose three to the screen.

Reference no: EM132196945

Questions Cloud

Determine the mean and standard deviation of distribution : Determine the mean and standard deviation of this distribution. The quality control manager of Marilyn's Cookies is inspecting a batch of chocolate-chip cookies
What will be the form of the contract curve : Let's suppose we are in an exchange economy with two agents, with a contract curve going through the point (4,8). The Edgeworth box is a square.
How does the fomc evaluate the balance of risks : In current (2018) business publications or on the Federal reserve web site (www. federalreserve.gov), find the press release from the most recent meeting.
Determine how much is the final payment : A company wants to replay a $118,155 debt making $271 quarterly payment for 27 quarters, then one final payment. If the interest is 5.5 per year.
Add a member function to print out all the information : Add a member function to print out all the information about a town. The member functions should all be publicly accessible.
What is the total amount of time supplied to the market : What is the total amount of time supplied to the labor market (that is, what is the total amount of time supplied to the market by all 10 individuals)?
Write a void function named sort with two args : Write a C Program: Using qsort, write a void function named sort with 2 args an unsigned that is the number of elements in the array.
Compare the content of the quantity variable to the number : Write the C++ if statement that compares the content of the quantity variable to the number 10.
Determine the type of triangle for the given lengths : Write a program that determines the type of triangle for the given lengths of the sides the triangle does not exist.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is a perfect decomposition

What is a perfect decomposition? Discuss differences in program replication techniques on mulcicomputers as opposed to program partitioning on multiprocessors.

  A string of space-delimited integers from an external file

Write an C code that reads a string of space-delimited integers from an external file ("whatin.txt"), stores them in the stack.

  The challenge for management has transitioned from a simple

over the twentieth century the ability to process information in terms of labor units has improved by a factor in the

  Obtain a minimal state table for sequential network

Obtain a minimal state table for a clocked synchronous sequential network having a single input line, x, in which the symbols 0 and 1 are applied, and single output line z

  Create a sub-function to read the data

Create a sub-function to read the data and build the A-matrix and B-vector from a single text file with m-rows and n-columns

  Write a program that defines a class die

Write a Die class with a constructor that accepts the number of sides as an argument.

  List and in brief describe the five-component model of an

list and briefly explain the five-component model of an information system. how can you use them?your response should

  Question1 decrypt the following encrypted quotation by

question1. decrypt the following encrypted quotation by shakespeare.fqjcb rwjwj vnjax bnkhj whxcq nawjvnfxdu mbvnu

  Find the common elements of two int arrays

Create a program that Finds the only element in an array that only occurs once.Create a program that Find the common elements of 2 int arrays.

  Write down the probability statement

Often it is difficult to distinguish between the probability of an intersection of outcomes (joint probability) and the probability of a conditional outcome.

  Assessing the importance of project management soft skills

Assessing the importance of project management soft skills in the context of project success rate. The response must be typed.

  Describe how an attacker could use a sniffer in conjunction

describe how an attacker could use a sniffer in conjunction with a trojan to successfully gain access to sensitive

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