代写C++代码 代做C++程序 C++辅导 C++教学

C++网络家教 远程写代码 在线Debug 讲解答疑 不是中介,本人直接写

微信: ittutor QQ: 14061936 Email: ittutor@qq.com

导航

代写PIC10B C++ polymorphism 远程写代码debug辅导

PIC 10B Homework 2 Due Wednesday, Feb. 5
Problem 1:
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. Figure 1 shows a sample output.
Good Coding Practices:
• think about cross-platform pause == cin.get() twice, write many nn vs. system(clear)
or system(’cls). )
• passing all objects by reference & or const &
• using field initializer list when possible in all constructors
Instructions for submission:
• Name your main file exactly hw2.cpp, and the rest being card.h, card.cpp, idcard.h,
idcard.cpp, bankcard.h, and bankcard.cpp.
• You may not use #include "stdafx.h".
• Add code description in the comment at the beginning of the file.
A sample description may look like:
/*
PIC 10B 2A, Homework 1
Purpose: Tic-tac-toe game
Author: Hanqin Cai
Date: 10/10/2019
*/
• Submit your header files and source codes to CCLE in separate files. Only .h and .cpp
files should be uploaded.
Due Wednesday, Feb. 5 Homework 2 PIC 10B
Grading
• Good Coding Practices (5 points)
• Compiling (5 points)
• Takes Correct Input (3 points)
• Gives Correct Output (3 points)
• Code (4 points)
PIC 10B Homework 2 Due Wednesday, Feb. 5
Figure 1: Sample input and output for Homework 2
 

相关推荐