Modify the CreditCard class from Code Fragment 1.3 to check that the price argument passed to function
Question:
Modify the CreditCard class from Code Fragment 1.3 to check that the price argument passed to function charge It and the payment argument passed to function make Payment are positive.
Data from in Fragment 1.3
The file CreditCard.cpp, which contains the definition of the out-of-class member functions for class CreditCard.
Transcribed Image Text:
#include
#include
#include "Credit Card.h"
// provides STL vector
// provides Credit Card, cout, string
// make std accessible
// Credit Card test function
// vector of 10 Credit Card pointers
// allocate 3 new cards
wallet [0] = new Credit Card ("5391 0375 9387 5309", "John Bowman", 2500);
wallet [1] = new Credit Card ("3485 0399 3395 1954", "John Bowman", 3500);
wallet [2] = new Credit Card ("6011 4902 3294 2994", "John Bowman", 5000);
using namespace std;
void test Card() {
vector wallet (10);
for (int j=1; j <= 16; j++) {
wallet [0]->chargelt (double(j));
wallet [1]->chargelt(2* j);
wallet [2]->chargelt (double (3 * j));
}
// make some charges
// explicitly cast to double
// implicitly cast to double
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 80% (15 reviews)
The CreditCard class from Code Fragment 13 should be modified to check that the price argument pa...View the full answer
Answered By
Tamondong Riza
Professionally, I am a teacher with years of experience tutoring math and science, as well as teaching in both public schools and independent schools. I feel that education should be an enlightening experience for all children, and I'm committed to helping my students learn new skills and make progress in their subjects.
0.00
0 Reviews
10+ Question Solved
Related Book For
Data Structures And Algorithms In C++
ISBN: 9780470383278
2nd Edition
Authors: Michael T. Goodrich, Roberto Tamassia, David M. Mount
Question Posted:
Students also viewed these Computer science questions
-
Modify the CreditCard class from Code Fragment 1.5 so that printSummary becomes a nonstaticmethod, and modify the mainmethod fromCode Fragment 1.6 accordingly.
-
Modify the CreditCard class from Code Fragment 1.2 to include modifier functions that allow a user to modify internal variables in a CreditCard class in a controlled manner. Data from in Fragment 1.2...
-
Modify the CreditCard class from Code Fragment 1.2 to charge interest on each payment. Data from in Fragment 1.2 A typical C++ program includes many different header files, which often include other...
-
Question 1 As at 31 December x5 the statement of financial position of Span and Cat was as follows: Ordinary shares of RM10 each Ordinary shares of RM1 each 7% preference shares of RM1 each 5.6%...
-
Some company managers forbid employees from using the Internet for non-work-related activities. What are the implications for e-marketers that segment their markets using the variable of home and...
-
Suppose that we define the following events: C = event that a randomly selected driver is observed to be using a cell phone A = event that a randomly selected driver is observed driving a passenger...
-
What is HRs role in ensuring consistent leadership in the organization? Think of an example from an organization you belong to. How does that organization prepare people for leadership roles? (p. 56)
-
Shannons account at Commerce Bank has a balance of $1,200. Shannons account number is 1236. Requirement 1. Assuming the bank uses encryption for customer account numbers and the last digit is a check...
-
Instructions For each of the cases below, do the following: Identifies and breaks down the deductions to which the taxpayer is entitled. Calculate the federal income tax. It determines how each...
-
In December, General Motors produced 6600 customized vans at its plant in Windsor. The labour productivity at this plant is known to have been 0.10 vans per labour-hour during that month; 300...
-
Modify the CreditCard class from Code Fragment 1.2 to charge a late fee for any payment that is past its due date. Data from in Fragment 1.2 A typical C++ program includes many different header...
-
Write a C++ class, Flower, that has three member variables of type string, int, and float, which respectively represent the name of the flower, its number of pedals, and price. Your class must...
-
Complete the following statements using either debit or credit: (a) The asset account Prepaid Insurance is increased with a _________. (b) The owners drawing account is increased with a _________....
-
Two firms are bidding for a $100 million contract in an all-pay auction. The bidding continues over many rounds, and each firm must incur a non-recoverable cost equal to 1% of the total value of the...
-
Illustrate the different steps required for the insertion of 58 followed by the deletion of 40 in the following AVL tree. 55 40 50 65 60 60 57 70 70
-
3 undamaged, the suit is returned to the customer. If either (or both) of the parts is (are) damaged, the suit goes to customer relations (Server 5). Assume that all travel times are negligible (0),...
-
Saginaw Incorporated completed its first year of operations with a pretax loss of $677,500. The tax return showed a net operating of $826,500, which the company will carry forward. The $149,000...
-
General Average Problem You've just learned about the concept of general average. Try applying it to the following hypothetical: A cruise ship docks close to Rome for three days, giving the...
-
A solenoid has a length of 15 mm and a radius of 0.25 mm, and consists of 5000 circular turns. If a current of 0.35 A is passed through the solenoid, what is the magnetic field at the center (inside...
-
Perform the indicated operations. In designing a cam for a fire engine pump, the expression is used. Simplify this expression. (3) (3 4 32
-
Give a recursive algorithmto compute the product of two positive integers, m and n, using only addition and subtraction.
-
Develop a nonrecursive implementation of the version of the power method from Code Fragment 5.9 that uses repeated squaring. 1 /** Computes the value of x raised to the nth power, for nonnegative...
-
Describe a recursive algorithm for converting a string of digits into the integer it represents. For example, '13531' represents the integer 13,531.
-
Just work out the assignment on your own sheet, you dont need the excel worksheet. Classic Coffee Company Best friends, Nathan and Cody, decided to start their own business which would bring great...
-
Financial information related to the proprietorship of Ebony Interiors for February and March 2019 is as follows: February 29, 2019 March 31, 2019 Accounts payable $310,000 $400,000 Accounts...
-
(b) The directors of Maureen Company are considering two mutually exclusive investment projects. Both projects concern the purchase of a new plant. The following data are available for each project...
Study smarter with the SolutionInn App