Define a class named creditcardpayment

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

Define a class named Payment that contains an instance variable of type double that stores the amount of the payment and appropriate accessor and mutator methods. Also create a method named paymentDetails that outputs an English sentence to describe the amount of the payment.

Next, define a class named CashPayment that is derived from Payment. This class should redefine the paymentDetails method to indicate that the payment is in cash. Include appropriate constructor(s).

Define a class named CreditCardPayment that derived from Payment. This class should contain instance variables for the name on the card, expiration date, and credit card number. Include appropriate constructor(s). Finally, redefine the paymentDetails method to include all credit card information in the printout.

Create a main method that creates at least two CashPayment and two CreditCardPayment objects with different values and calls payment Details for each.

 

Reference no: EM13333456

Questions Cloud

Define a class for file that is derived from document : Similarly, define a class for File that is derived from Document and includes a instance variable for the pathname. The textual contents of the file should be stored in the inherited variable text. Redefine the toString method to concatenate all t..
Create a class called vehicle : Create a class called Vehicle that has the manufacturer's name (type String), number of cylinders in the engine (type int), and owner (type Person given below).
Determine the risk-free rate according to capm : the return on the market portfolio is currently 12%. mobile phone corporation stockholders require a rate of return of 30% and the stock has a beta of 3.2. according to capm, DETERMINE THE RISK-FREE RATE.
Calculate the new angular speed of the student : A student sits on a rotating stool holding two 3.6-kg objects. When his arms are extended horizontally, Find the new angular speed of the student
Define a class named creditcardpayment : Create a main method that creates at least two CashPayment and two CreditCardPayment objects with different values and calls payment Details for each.
Consulting the attorney of record : 1. Is it in violation of the Canons of Ethics for an attorney being a member of a district attorney's staff to attempt to elicit a confession or statement from a defendant charged with the criminal offense without consulting the attorney of recor..
What is the frequency of the piano wire : A piano tuner hears 2.0 beats per second between his 440 Hz tuning fork and a piano wire that has a lower pitch sound
Define a class named payment that contains an instance : Define a class named Payment that contains an instance variable of type double that stores the amount of the payment and appropriate accessor and mutator methods.
A violation of the canons of ethics for a lawyer : 1. Is it a violation of the Canons of Ethics for a lawyer to try a civil case on a contingent fee basis in a court in which his father is the judge?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program to make the ssds function

Write a program to make the SSDs function as a MM:SS real-time clock. Hint: You must not use a single delay routine for the one second delay because that will not allow for persistence of vision. The displays need to be constantly refreshed during ev..

  Write a c program to search a list of integers

Write a C program to search a list of integers for a particular value. The user should be prompted to enter the value to be searched for. Your program will then print out whether the value was found or not.

  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 a segment of code that prints the number of elements

Assuming the array x has been defined as: int x[n]; for some n and that values have been assigned to all the elements. Write a segment of code that prints the number of elements between (but not including) the largest and smallest values in the array..

  Is a void function a function that does not return a value?

Is a void function a function that does not return a value?

  Is the code properly commented

Does each case in a switch statement terminate with a break? Is there a default case?

  Reads a set of integers from file

The code in file "hw5-stree.cpp" reads a set of integers from file and inserts them into a binary search tree. You are asked to implement two functions max() and depth() that compute the maximum element and the depth of the binary search tree.

  Write code that declares an int array named month

Write code that declares an int array named month with 5 rows and 7 coloumns and initializes every element to -1.

  Write a function that computes length of a character string

Write a function that computes the length of a character string (i.e. write your own implementation of the strlen function.

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Program reads a number and prints all of its binary digit

Write a program that reads a number and prints all of its binary digits. Print the remainder number % 2, thenreplace the number with number / 2. Keep going until the number is 0.

  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