0% found this document useful (0 votes)
17 views

Starting Out With C++ by Tony Gaddis, (8 Edition PDF Book Shared On Group) Chapter 13 Introduction To Classes

The document provides instructions for two programming assignments: 1) A card game simulation called "Fazool Game" that evaluates different hands such as pairs, flushes, and straights. Students are instructed to create classes to represent cards and the game. 2) A bank system simulation with classes for customers and accounts. A customer can have up to 3 accounts. The program should allow adding customers and accounts, as well as depositing and withdrawing from accounts while updating balances. Functions are needed to view customer and account details.

Uploaded by

Sadiq Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Starting Out With C++ by Tony Gaddis, (8 Edition PDF Book Shared On Group) Chapter 13 Introduction To Classes

The document provides instructions for two programming assignments: 1) A card game simulation called "Fazool Game" that evaluates different hands such as pairs, flushes, and straights. Students are instructed to create classes to represent cards and the game. 2) A bank system simulation with classes for customers and accounts. A customer can have up to 3 accounts. The program should allow adding customers and accounts, as well as depositing and withdrawing from accounts while updating balances. Functions are needed to view customer and account details.

Uploaded by

Sadiq Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

OOP BIT F16

Assignment 03A [For students exempted from Assignment 03]


Show me on Monday 1 January 2018 in my Room (On your laptop or email ZIP file before coming)

Note 1: Do read assignment 3 carefully (You are not required to submit) and cover the concepts, I will take
one or more quiz covering the assignment content from all students.
Note 2: .
Starting Out with C++ by Tony Gaddis, (8th Edition pdf book shared on group)
Chapter 13 Introduction to Classes
Page 807-810: Q 15, Q19, and Q20
Additionally simulate a card game called "Fazool Game." The details are ahead. Put your maximum effort on
design that is create suitable classes and choose appropriate member function for each class.
The card deck contains 52 cards, 13 of each type. At the beginning of the game, shuffle the cards. You need
to devise a fair method for shuffling. (It does not have to be efficient.) After shuffling, present five top cards
to the player. You have to evaluate the turn that is these five cards. Your program should pronounce it one
of the following:
 No pair—The lowest turn, containing five separate cards that do not match up to create any of
 the turns below
 One pair—Two cards of the same value, for example two queens
 Two pairs—Two pairs, for example two queens and two 5’s
 Three of a kind—Three cards of the same value, for example three queens
 Straight—all cards with consecutive values, not necessarily of the same suit, such as 4, 5, 6, 7, and 8.
The ace can either precede a 2 or follow a king
 Flush—Five cards, not necessarily in order, of the same kind
 Full House—Three of a kind and a pair, for example three queens and two 5's
 Four of a Kind—Four cards of the same value, such as four queens
 Straight Flush—A straight and a flush: Five cards with consecutive values of the same suit
 Royal Flush—A 10, jack, queen, king, and ace, all of the same kind
Guidelines:
- Use "int" array of size 52. Say cards of first types are numbered 1-13, second type are numbered
14-26 and so on. Using integer division by 13 you can get 1,2,3,4 as type and using modulus again
by 13 you can get number from 0 to 12, where 0 is 13 or Ace and 1 is 2
- Shuffling is simple. Generate two random numbers between 0-52 (52 not included) and swap card
numbers like:
n1=...
n2=...
temp=card[n1]
card[n1]=card[n2]
card[n2]=temp
- Use of functions is encouraged. Use static array that is declare out of functions but inside class to
access array in all function without passing
- Write functions for all possible types, you may implement any number of types as per availability of
time.
- Chapter 14 More about Classes
- Page 889: Q14, Q15

Abdul Mateen PUCIT


OOP BIT F16
Additionally simulate Bank System. Bank has customers & accounts. A customer may have one, two or
maximum three accounts only. Customer has first name, last name, age (in years only), and dynamic three
accounts because a customer may have one account only. Account has account no, opening date, starting
balance, current balance. Customer can do any transaction of deposit & withdraw provided account has
balance (in case of withdraw only). Transactions are stored separately, for each valid transaction only
current balance updating required in Account. Bank can have maximum 100 customers, whereas, any no of
customers less than equal 100 can exist at any time. Create a dynamic array of customers using pointer
array of customers. Bank officer can add new customer, if customers are less than 100, otherwise refuse.
Bank officer may add new account for any customer, if customer has less than 3 accounts. Other than
getters, setters, constructors, & add write following functions to:
- print details of all customers only
- print details of specific customer only
- print details of all accounts of any customer
- print details of specific account of any customer
- print complete details of customer & all account of every customer

Abdul Mateen PUCIT

You might also like