A company that market is publishing both book and audio cass

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

A company that market is publishing both book and audiocassette versions. Below is an

 

implementation of the class publication.

 

Hint: Separate class interface from the implementation.

 

#include <iostream>

 

#include <string>

 

using namespace std;

 

class publication

 

private:

 

string title;// publication that stores the title (a string)

 

float price; // price (type float) of a publication

 

public:

 

publication(){title =""; price=0 }

 

publication(string t, float p){ title=t; price=p;}

 

void getdata()

 

{

 

cout << "\nEnter title: "; cin >> title;

 

cout << "Enter price: "; cin >> price;

 

}

 

void putdata() const

 

{

 

cout << "\nTitle: " << title;

 

cout << "\nPrice: " << price;

 

}

 

From this class derive two classes:

 

1- Class Book which contains:

 

i) A parameterized constructor that initializes its entire data in addition to the base

 

ii) Data member page count of type int.

 

iii) getdata() function to get its data from the user at the keyboard.

 

iv) putdata() function to display its data.

 

2- Class Tape which contains:

 

i) A parameterized constructor that initializes its entire data in addition to the base

 

ii) Data member playing time in minutes of type float.

 

iii) getdata() function to get its data from the user at the keyboard.

 

iv) putdata() function to display its data.

 

3- Write a main() program to test the book and tape classes by creating instances of

 

them, set the data and print it.

 

class data members.

 

class data members.

 

 

Reference no: EM13164959

Questions Cloud

State the solution of sulfuric acid : What is the pH (3 significant figures to the right of the decimal point) of a 0.0500 M solution of sulfuric acid? Remember, the first ionization constant is "large,"
Program that reads a file of computer data names computers : write a program that reads a file of computer data names computers.txt. creates an array of Computer objects.
What is the pressure of the dry gas alone : a 251 mL sample of oxygen is collected over water at 25 deg C and 760 torr pressure. If the vapor pressure of water as 25 deg C is 23.8 torr, what is the pressure of the dry gas alone?
What is the value of q : When 1 mole of H2(g) reacts with C2H4(g) to form C2H6(g) according to the following equation, 137 kJ of energy are evolved. What is the value of q?
A company that market is publishing both book and audio cass : A company that market is publishing both book and audiocassette versions
What is the mass in grams of the lead : The water level in a graduated cylinder initially at 210 mL rises to 277 mL after a piece of lead is submerged. What is the mass in grams of the lead?
Program that will read in such an array : Write a program that will read in such an array, and repeatedly prints it so the user can select the direction in which to move next. The user's requested move can prompt a number of responses
Terrorist groups sprung up around the globe : Why have terrorist groups sprung up around the globe? What kinds of governments and policies make for a breeding ground for this type of "resistance"?
Calculate the molarity of ascorbic acid in the solution : A solution containing 82.0 g of ascorbic acid dissolved in 230 g of water has a density of 1.22 g/mL. Calculate the molarity of ascorbic acid in the solution.

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