CSC 241 Introduction to Computer Science Assignment

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

CSC 241 Introduction to Computer Science - DePaul University

1. Imagine a publishing company that markets both book and audiocassette versions of its works. Create a class publication that stores the title (a string) and price (type float) of a publication. From this class derive two classes: book, which adds a page count (type int), and tape, which adds a playing time in minutes (type float). Each of these three classes should have a getdata ( ) function to get its data from the user at the keyboard, and a putdat a ( ) function to display its data.

Write a main ( ) program to test the book and tape classes by creating instances of them, asking the user to fill in data with getdata( ), and then displaying the data with putdata( ).

2. Start with the publication, book, and tape classes of Exercise 1. Add a base class sales that holds an array of three floats so that it can record the dollar sales of a particular publication for the last three months. Include a getdata( ) function to get three sales amounts from the user, and a putdata () function to display the sales figures. Alter the book and tape classes so they are derived from both publication and sales. An object of class book or tape should input and output sales data along with its other data. Write a main ( ) function to create a book object and a tape object and exercise their input/output capabilities.

3. Assume that the publisher in Exercises 1 and 3 decides to add a third way to distribute books: on computer disk, for those who like to do their reading on their laptop. Add a disk class that, like book and tape, is derived from publication. The disk class should incorporate the same member functions as the other classes. The data item unique to this class is the disk type: either CD or DVD. You can use an enum type to store this item. The user could select the appropriate type by typing c or d.

4. Derive a class called employee2 from the employee class in the EMPLOY program in this chapter. This new class should add a type double data item called compensation, and also an enum type called period to indicate whether the employee is paid hourly, weekly, or monthly. For simplicity you can change the manager, scientist, and laborer classes so they are derived from employee2 instead of employee. However, note that in many circumstances it might be more in the spirit of OOP to create a separate base class called compensation and three new classes manager2, scientist2, and laborer2, and use multiple inheritance to derive these three classes from the original manager, scientist, and laborer classes and from compensation. This way none of the original classes needs to be modified.

5. Start with the publication, book, and tape classes of Exercise 1. Suppose you want to add the date of publication for both books and tapes. From the publication class, derive a new class called publication2 that includes this member data. Then change book and tape so they are derived from publication2 instead of publication. Make all the necessary changes in member functions so the user can input and output dates along with the other data. For the dates, you can use the date class from Exercise 5 in Chapter 6, which stores a date as three ints, for month, day, and year.

6. There is only one kind of manager in the EMPMULT program in this chapter. Any serious company has executives as well as managers. From the manager class derive a class called executive. (We'll assume an executive is a high-end kind of manager.) The addi-tional data in the executive class will be the size of the employee's yearly bonus and the number of shares of company stock held in his or her stock-option plan. Add the appropriate member functions so these data items can be input and displayed along with the other manager data.

Reference no: EM132712469

Questions Cloud

Explain the types of control strategies : Chose two of the four types of control strategies and discuss how they work and how effective they are. Give your opinion as to whether they should remain.
What is the overage cost of the bookstore : What is the overage cost of the bookstore for purchasing a copy of the newspaper?
Prepare all entries necessary on the consolidated statements : Prepare, in general journal form, all entries necessary on the 12/31/2020 consolidated statements workpaper to eliminate the effects of intercompany sales.
Describe what efforts or programs are most effective : A fundamental issue established at the outset of this course is the fact that becoming involved in terrorist activities is a process, where numerous factors.
CSC 241 Introduction to Computer Science Assignment : CSC 241 Introduction to Computer Science Assignment Help and Solution, DePaul University - Assessment Writing Service - Create a class publication that stores
Critical ratio to decide the optimal number : What is the critical ratio to decide the optimal number of newspapers to buy for the bookstore?
Make all the necessary eliminating entries on a consolidated : On January 1, 2014, Paterson Company purchased 60%. Make all the necessary eliminating entries on a consolidated statements workpaper on 12/31/2020.
What is meant by the expression robust model : Explain what is meant by the expression "robust model" Provide examples and clear explanations.
Cost implications of reactive maintenance : What are the cost implications of reactive maintenance? Be specific and provide at least one example.

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