Create a base class to store the above information

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

Program :- 1

A Hospital wants to create a database regarding its indoor patients. The information to store include 

a) Name of the Patient
b) Date of Admission
c) Disease
d) Date of Discharge

Create a structure to store the date (year, month and date as its members). Create a base class to store the above information. The member function should include functions to enter information and display a list of all the patients in the database. Create a derived class to store the age of the patients. List the information about all the to store thje age of the patients. List the information about all the pediatric patients(less than twelve years in age)

Program :- 2

Write a program that creates a binary file by reading the data for the students from the terminal. The data of each student consist of roll no., name ( a string of 30 or lesser no. of characters ) and marks. 

Program :- 3

Make a class Employee with a name and salary. Make a class Manager inherit from Employee. Add an instance variable, named department, of type string. Supply a method to tostring that prints the manager's name, Department and salary. Make a classs Executive inherit from Manger. Supply a method to string that prints the string "executive " followed by information stored in the manager superclass object. Supply a test program that tests these classes and methods. 

Program :- 4

Imagine a tollbooth with a class called toll booth. The two data items are of type unsigned int to hold the total number of cars, and a type double to hold the total amount of money collected. A constructor initializes both these to 0. A member functions called payingcar() increments the car total and adds 0. 50 to the cash total. Another function, called nopaycar(), increments the car total but adds nothing to the cash total. Finallu a member function called displays the two totals. 

Include a program to test this class. This program should allow the user to push one key to count a nopaycar. Pushing the ESZ key should cause the program to printout the total cars and total cash and then exit. 

Program :- 5

Write a function called reversit() that reverses a string (an array of char ). Use a for loop that swaps the first and last characters, then the second and next to lastcharacters and so on. The string should be passed to reversit() as an argument. 

Write a program to exercise reversit(). The program should get a string from the usre, call reversit(), and print out the result. Use an input method trhat allows the embedded blanks. Test the program with Napoleons famous phrase, "Able was I ere I Saw Elba)". 

Program :- 6

Assume that a bank maintains two kinds of accounts for customers, one called as savings account and other as current account. The savings account provides compound interest and withdrawl facilities but no cheque book facility. The current account provides cheque book facility but no interest. Current account holders should also maintain a minimum balance and if the balance falls below this level, a service charge is imposed. 

Create a class account that stores customer name, account number and type of account. From this derive class es curr_acct and sav_acct to make them more

specific to their requirements. 

Include necessary member functions in order to achieve the following tasks:

a) Accept deposit from a customer and update the balance

b) Display the balance

c) Compute and deposit interest. 

d) Permit Withdrawal and update the balance

e) Check for the minimum balance, impose penalty, necessary and update the balance. 

f) Do not use any constructors. Use member functions to initializes the class members. 

Program :- 7

Create a base shape. Use this class to store two double type values that could be used to compute the area of figures. Derive two specific classes called triangle and rectangle from the base shape. Add to the base class, a member function get_data() to initialize base class data members and another member function display_area() to compute and display the area of figures. Make display_area() as a virtual function and redefine this function in the derived classes to suit their requirements. 

Using these three classes, design a program that will accept dimensions of a triangle or a rectangle interactively and display the area. 

Remember the two values given as input will be treated as lengths of two sides in the case of rectangles and as base and height in the case of triangles and used as follows:

Area of rectangle = x* y
Area of triangle = ½ * x * y

Reference no: EM131097469

Questions Cloud

Calculate the optimum transmit dl and ul power values : Explain the network behaviour if the channel gain of terminal 4 with base station 1 has decreased according to the shadowing effect = 120 dB.
Was national insurance justified in suspending erskine : Did Helen Barnett's actions invade James Erskine's right to privacy? Was National Insurance justified in suspending Erskine? What should be the key elements of an employee computer and Web use policy?
Price indexes-what is the inflation rate : Consider the following price indexes: 90 in 2008, 100 in 2009, 110 in 2010, 121 in 2011, and 150 in 2012. (show all work) What is the base year? How do you know this? What is the inflation rate between 2009 to 2010?
Compute the expected return-standard deviation : Compute the expected return, standard deviation, and value at risk for each of the following investments: Investment (A): Pays $100 three-fourths of the time and a $140 loss otherwise.
Create a base class to store the above information : Create a structure to store the date (year, month and date as its members). Create a base class to store the above information. The member function should include functions to enter information and display a list of all the patients in the database. ..
What is the tariff revenue : Suppose 2.5 million tons of bananas were imported in 2006 but then the tariff decreased to €152 a ton in 2007 and as a result, 3 million tons were imported in 2007. What is the tariff revenue in 2007?
Write a report with matlab simulations about the maximum : Partial feedback II: only SINR at each antenna element is known at the transmitter (full and quantized).
Discuss sga strategy in managing the representation campaign : What was the impetus for the Amalgamated Clothing and Textile Workers Union (ACI'WU) organizing effort at SGA Industries? Discuss SGA's strategy in managing the representation campaign.
A block-structured language : Consider a block-structured language in which a name can be declared to be an Integer or a real. Suppose that expressions are represented by a terminal expr and that the only statements are assignments. conditionals. whiles, and sequences of state..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  What is a memory location

Assume that memory location 1200 is allocated for p and memory location 1800 is allocated for num.

  Write a complete c++ program

The main program will read in a parameter value n (read this in main). Then it will call a function read2arrays (details below) to read lists of grades into two arrays, which the main program will call test1 and test2 (or some other names of your ..

  Implement the basic properties of a bank account

Define the class bankAccount to implement the basic properties of a bank account. An object of this class should store the following data:

  Write a method changeblue

Write a method changeBlue(weight). Do not change any color of the pixels in the first half of a picture. For the second half, change blue value of each pixel by new blue=original blue * weight. For example, if a pixel has values (200,100,100) and ..

  Create a friend class

Create a Friend class that contains a first name, last name, a birthday, and a telephone number. Create a Contacts class that contains an array of Friend as well as the owner's name and cell phone Number.

  What is memory leakage

What are the main conceptual differences between object-oriented programming and the other programming techniques and what is the definition of reference variable? What are the differences between pass-by-value and pass-by-reference?

  Design and implement a library system that does the

design and implement a library system that does the following ? takes details of a studentlibrary users first name last

  Write the prototype and header for a function

Write the prototype and header for a function called calculate. The function should have three parameters: an int, a reference to a double, and a long (not necessarily in that order). Only the int parameter should have a default argument, which is..

  Up through 2 to the 10th power

program should compute and output all of the "powers of two" from 2 to the 0th power, up through 2 to the 10th power.

  Integerset class create class integerset for which each

integerset class create class integerset for which each object can hold integers in the range 0 through 100. represent

  Develop an application for the game of memory

Use object-oriented programming to develop an application for the game of memory. Memory consists of a 20 × 20 grid of face down cards where there is at most one pair of each card in the grid. The types of cards that are available in this versi..

  We wish to process survey results

Suppose we wish to process survey results that are stored in a file. This exercise requires twoseparate programs. First, create a program that prompts the user for survey responses and outputseach response to a file

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