Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Card Class. Submit the files with exactly the name Card.h, Card.cpp, main Card.cpp, Write code in c++ that uses polymorphism to make printing out similar

image text in transcribed

Card Class. Submit the files with exactly the name Card.h, Card.cpp, main Card.cpp, Write code in c++ that uses polymorphism to make printing out similar objects using their appropriate attributes. The program will prompt the user to input as many cards as desired, including driver license, passports, library cards, university ID cards, bank cards, and credit cards. It will then print all the cards in ascending order of expiration date, such that the cards that expire the soonest are printed first, and those without expiration date are printed last. To do this, consider all cards belong to three main categories: basic cards, ID cards, and bank cards. Basic cards only contain the name of the institution, the name of the person, and sometimes an expiration date. ID cards such as your driver license or passport number can also contain an ID number and date of birth (DOB). Bank cards contain an account number and a card security code number. Instructions Create a base class Card as well as derived classes IDCard and BankCard with data fields as explained above. Write any necessary member functions and non-member functions such that your program prompts the user to input as many cards as desired and then prints them all in order of expiration date. Outline all the member functions and non-member functions we needed for this program before you start! Only need to consider users inputs are valid. Code should look like picture exactly in 3 files!!

Print Cards by selecting the type ( when done) : 1. Basic Card 2. ID Card 3. Bank Card Card Type : 3 Institution nawe : BANK OF AMERICA Card holder name : Jane Baker Expiration date maddyy ( 0 if none) : 08282023 Account number : 3456478318001 Card Security Code : 353 LIBRARY CARD name : Andrew Tzuo exp:93/28/2017 Card Type : 1 Institution natie : UCLA I CSC : 749 Card holder name : Andrew Tzuo Expiration date madyyy ( 0 if none) : 0 Card Type : 2 BANK OF AMERICA Institution name : UCLA BRUIN CARD name : Jane Baker Card holder name : Ashley Phillips 10 number : 352573968 I CSC : 353 DOB middyyy ( if not 1 isted) : 0 Card Type : 1 UCLA Institution name : LIBRARY CARD name : Andrew Tzuo Card holder name : Andrew Tzuo exp:N/A. Expiration date middyyy ( 0 if none) : 03282017 Card Type : 3 UCLA BRUIN CARD Institution name : CHASE nane : Ashley Phillips Card holder name : Jane Baker Expiration date niddyyy ( 0 if none) : 03252022 exp:N/A. Account nuber : 907929028294 ID\# : 352573968 Card Security Code : 749

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Consider the ketones piperitone menthone, and isomenthone.

Answered: 1 week ago

Question

So what disadvantages have you witnessed? (specific)

Answered: 1 week ago

Question

3. You can gain power by making others feel important.

Answered: 1 week ago