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 to input miles driven and gallons used

Create a program in C++ which will input miles driven and gallons used (both as integers) for each tankful. Program must compute and display the miles per gallon

  Program to print out invalid number to character

The integer must contain 3 distinct non-zero number, or the program will print out invalid number.it should print out invalid query.

  Create a 1-dimensional (1d) array

Write a program to create a 1-dimensional (1D) array that contains 15 characters and display to the screen a count of the occurrences of each of the vowels a, e, i, o, and u in the array.

  Create a graphical (not text-based) visual c++ program

Create a graphical (not text-based) Visual C++ program that allows the user to enter the coefficients for a system of four equations with four unknowns. Include a button that when clicked, will solve the system of equations and display the results in..

  Design, write, and test a program

Design, write, and test a program that represents some of the aspects of a student

  Write a matrix multiplication program

Write a C++, matrix multiplication program which you can instrument to monitor and measure execution time as a function of problem size. Make sure it works in Microsoft Visual Studio.

  Write a program using vectors and iterators

Create a program that uses at least two functions that will be called from your main. This program is a number game program that asks for parts of your phone and after manipulating it mathematically, eventually outputs your entire phone number. The d..

  Write a c program that reads in five numbers

Q1. (Bar Chart /Histogram printing) Write a C program that reads in five numbers (each between 1 and 30). For each number read, your program should print a line containing that number of adjacent asterisks. For example, if your program reads the numb..

  Write a function to compute the volume of a cone

write a function to compute the volume of a cone by using the base radius r and the height h of the cone as the parameters of the function Vcone = xr^2h/3

  C program to calculate power loss in transmission line

Write program in C to calculate the power loss in transmission line with resistance of 0.05 ohms/mile. Calculate power loss if 500 kW of power is transmitted from power generation station

  Given the following test scores and grade equivalents

Given the following test scores and grade equivalents, write a function which is passed a score, and returns a letter grade based on the score entered. A number less than 0 or greater than 100 is invalid.

  Write a c program that asks for and reads in two integers

Write a C program that asks for and reads in two integers and then reports if one is a multiple of the other.

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