Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write code that uses polymorphism to make printing out similar objects using their appropriate attributes. The program will prompt the user to input as many

Write code 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. 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. Follow the format shown in the output sample exactly and abide by good coding practices. Compile your code and run your program to check for compile-time errors and logic errorsimage text in transcribed

*Wal Let Printer * Print Cards by selecting the type (0 when done) 1. Basic Card 2. ID Card 3. Bank Card I LIBRARY CARD Card Type : 3 name Andrew Tzuo exp : 03/28/201 Institution name: BANK OF AMERICA Card holder name Jane Baker Expiration date mnddyyy ( if none): 08282823 Account number 3456478310001 Card Security Code 353 | CHASE name Jane Baker exp : 03/25/2022 Card Type 1 Account# : 907929020294 Institution name UCLA Card holder name: Andrew Tzuo Expiration date mmddyyy ( if none) : 0 CSC 749 | BANK OF AMERICA Card Type : 2 name: Jane Baker exp : 08/28/2023 Institution name UCLA BRUIN CARD Card holder name : Ashley Phillips Expiration date mmddyyy (0 if none) : 0 ID number 352573968 DOB mmddyyy ( if not listed) 0 I Account# : 3456478310001 CSC 353 Card Type 1 I UCLA name Andrew Tzuo Institution name LIBRARY CARD Card holder name: Andrew Tzuo Expiration date mmddyyy ( if none) 03282017 exp : N/A. I UCLA BRUIN CARD Card Type : 3 name Ashley Phillips exp N/A. Institution name CHASE Card holder name: Jane Baker Expiration date mmddyyy (0 if none) : 03252022 Account number 907929020294 Card Security Code: 749 ID# : 352573968 DOB N/A

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_2

Step: 3

blur-text-image_3

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

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

=+What is the extent of the use of each type of IE?

Answered: 1 week ago