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

  Implement a function to recursively

Implement a function to recursively determine if a word is a palindrome. A palindrome is a word, phrase, number, or other sequence of symbols or elements, whose meaning may be interpreted the same way in either forward or reverse direction.

  Take an n x n matrix, and create a new, (n-1) x (n- 1)

take an N x N matrix, and create a new, (N-1) x (N- 1), matrix with each element being the sum of four nearby elements. You need to figure out a way to break the matrix up into squares and iterate through the matrix, while staying within its bounds.

  Program to next the loops in either direction

You can write your program to next the loops in either direction, that is, process row-by-row or column-by-column. Explain which way you would choose to process the data.

  Program to compute gross wages for employee using array

Write program which uses the following arrays: payRate: array of seven floats to hold each employee's hourly pay rate. wages: array of seven floats to hold each employee's gross wages.

  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..

  Write a program that reads in a list of integer numbers and

Write a program that reads in a list of integer numbers and print out the sum of all numbers, the average, the lowest and the highest value entered. The first input number indicates how many numbers the program is attempting to read. For example, if ..

  Write program using c language to find page fault

Write program using c language to find page fault for individual processes, group of processes and system as whole using following system call int sys_pgfltstats(pid_t pid,int flag,pf_info_struct *info).

  Program to generate 100,000 prime numbers

Write a POSIX C/C++ program to generate 100,000 prime numbers. Assume that the program will be run on a computer with 5 CPUs and that your goal is to have this program finish as quickly as possible.

  You will write a program that reads a text file

You will write a program that reads a text file, counts the number of words in the file, and the number of occurrences of each character. It will print to a file the number of words, and the number of occurrences of each character, as well as the ..

  Write a program to accept a number representing

Write a program to accept a number representing how many first names the user willenter from the command line (5 names maximum), and the actual first names, fromthe command line. Create an array dynamically that has the same size as number ofnames.

  Extend the definition of the class clocktype by overloading

a. Extend the definition of the class clockType by overloading the post-increment operator function as a member of the class clockType

  Write a c program that reads a data file of floating numbers

Write a program that reads a data file of floating numbers into an array and prints the array elements along with the number of items in the array

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