Discount COMP220 COMP 220 COMP/220 All Labs 1 2 3 4 5 6 7 - All Weeks - Week 1 - Week 2 - Week 3 - Week 4 - Week 5 - Week 6 - Week 7
    COMP220 COMP 220 COMP/220 All Labs 1 2 3 4 5 6 7 - All Weeks - Week 1 - Week 2 - Week 3 - Week 4 - Week 5 - Week 6 - Week 7 COMP220 COMP 220 COMP/220 All Labs 1 2 3 4 5 6 7 - All Weeks - Week 1 - Week 2 - Week 3 - Week 4 - Week 5 - Week 6 - Week 7 COMP220 COMP 220 COMP/220 All Labs 1 2 3 4 5 6 7 - All Weeks - Week 1 - Week 2 - Week 3 - Week 4 - Week 5 - Week 6 - Week 7

COMP220 COMP 220 COMP/220 All Labs 1 2 3 4 5 6 7 - All Weeks - Week 1 - Week 2 - Week 3 - Week 4 - Week 5 - Week 6 - Week 7

$92.95
$123.93

COMP/220 iLab 1 of 7 - C++ Course

Enter the following source, which will set up the 2D array and the recommended variable declarations. It is up to the student to design and implement the remainder of the program code.

// Programmer:  (put your name here)

// Course:  COMP220

// Assignment:  Two-Dimensional Arrays

// Description:  The program will use a 2D array and a random-number 
// generation to play Blackjack and keep track of a playing-card deck.

// Input:  User data entry and a playing-card deck represented as a two-
// dimensional array

// Output:  A screen display showing the current card hands of each player
// and the dealer, their score, win and lose status, and a final representation
// of the card deck after the game is over

#include 
#include 
#include

using namespace std;

void main (void)

{
bool bPlayerDraw[5];    //Boolean to determine if player holds (F)

//or draws card (T)

char cPlay = 'N';       //Character variable for play game input
char cCardDeck[4][13];  //Character array representing the card deck
int iCard;              //Card array index
//0 = 2 card                                                              
//1 = 3 card
//2 = 4 card
//3 = 5 card
//4 = 6 card
//5 = 7 card                                                           
//6 = 8 card                                                         
//7 = 9 card                                     
//8 = 10 card                                                       
//9 = jack card
//10 = queen card
//11 = king card
//12 = ace card
int iNumberOfDraws = 0; //Number of rounds of card draws
int iSuit;                             //Suit array index

 //0 = diamonds
//1 = hearts
//2 = clubs
//3 = spades

// ASCII character display reference for display card suit symbols
//3 = heart symbol
//4 = diamond symbol
//5 = club symbol
//6 = spade symbol

int iNumberOfPlayers = 0;//Number of players in current game
int iPlayerCount[5];      //Integer array to holder each player's count
                                   //iPlayer[0] is always the dealer
int iHighestCount = 0;  //Highest count for a single game
int k, m;                       //integer loop counters
srand(GetTickCount());  //Seed the random-number generator

 //Main game loop
//Enter your code here…

Here is a sample of the finished program’s output.

Welcome to Honest Sam's Blackjack Table

Glad to have you back!

Enter the number of players in the game.
There must be at least one player but no more than four.
Number of players:  3

                     Dealer   Player 1  Player 2  Player 3
Card 1:          5♣        7♠       4♥        Q♥
Card 2:          5♠        K♥       5♥        2♠
Card 3:          J♥        4♠        6♣       10♥
Card 4:        Hold      Hold      Q♣      Hold
Card 5:        Hold      Hold      Hold     Hold

Final:           20        21        25        22
Lose      Win!      Lose      Lose

Display entire card deck, rows = suits, columns = card

0 = dealer card, 1 = Player 1 card, 2 = Player 2 card, etc.

COMP/220 iLab 2 of 7 - C++ Course

 

i L A B  O V E R V I E W      

Scenario and Summary 

This lab requires you to create a multifile C++ project in order to design and implement an object-oriented program using a class to model the characteristics and function of a resistor.

Deliverables

Submit a single Notepad file containing the source code for Exercise 1 to the Dropbox for Week 2. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name; see the following example: YourLastName_Lab1.txt.

Each program should include a comment section that includes (at a minimum) your name, the lab and exercise number, and a description of what the program accomplishes.

Submit a lab report (a Word document) containing the following information to the Dropbox for Week 2.

Include your name and the exercise number.

Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.

Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results.

Summary and Conclusions: Include a summary of what the lab demonstrated and any conclusions drawn from the testing of the lab program.

Answers to Lab Questions: Answer any and all lab questions included in the lab steps.

Summary: Write a statement summarizing your predicted and actual output. Identify and explain any differences.

Conclusions: Write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solved it or, if you had no significant problems, something you learned by doing the exercise.

Each lab exercise should have a separate section in the lab-report document.

Your lab grade will be based upon

the formatting of your source code;

the use of meaningful identifiers;

the extent of internal documentation; 

the degree to which an exercises’ specifications are met; and

the completeness of your lab report.

i L A B  S T E P S  

STEP 1: Create a Multifile Project             

Objective: Create a C++ console application that will model the characteristics of a resistor.

Create a multifile project. Create and add to the project an h file containing the resistor-class definition.

Create and add to the project a cpp file containing the implementation of the class-member functions.

Create and add to the project a ccp file containing the main() function, which will instantiate a resistor object and test its member functions.

STEP 2: Required Class Members             

The resistor class will, at minimum, have members that do the following.

store the nominal resistance value of a resistor

store the tolerance of a resistor

initialize any and all nominal-resistance values to correct, EIA, nonzero values that are greater than 0 and less than 1,000,000 ohms

initialize any and all resistance-tolerance values to correct, E12, E24, E48, or E96 resistance-tolerance values

allow the nominal-resistance and tolerance values of a resistor object to be changed by the user

All member functions should have a test message stating the name of the function. All the test messages should be displayed or not displayed, depending on the value of a Boolean variable declared in main().

If the Boolean value = true, display the message.

If the Boolean value = false, do not display the message.

STEP 3: Program Operations       

Function main() should instatiate two objects of class resistor.

Function main() should display the current values of all resistor objects.

Function main() should also calculate and display the minimum and maximum in-tolerance resistance values of each resistor object from the resistor data members.

Function main() should allow the user to change the values of the nominal resistance and the resistor tolerance of both resistor objects, and it should also correctly handle out of numeric-range input. Main() is also responsible for making sure that the user can successfully enter only correct, EIA resistance and tolerance values.

The user should be given the following data-entry choices:

accept current EIA values for resistance and tolerance;

The function main() should display the new, modified values of the resistor object, including the new min and max in-tolerance resistance values.

The function main() should be executed twice: once with the test messages displayed and once without.

STEP 4: Lab Questions   

You are not required to copy the question text into your document, but all answers should be listed with the question number they answer.

List the complete reference-source information for where you found the EIA standard resistor value and tolerance information.

How was this reference discovered and where?

The constructor requires the initialization values for the nominal resistance and the tolerance when an object is instantiated to be a correct E-series resistance and tolerance combination. Describe how this was accomplished in your program design and implementation.

In the lab, you were required to provide mutator functions to change the nominal-resistance and tolerance values of a resistor object.

Describe how this was accomplished so that the user could not enter an invalid nominal-resistance and E-series tolerance combination.

Describe how this process was different and/or similar to how you implemented this validation in the class constructor.

COMP/220 iLab 3 of 7 - C++ Course

 

i L A B O V E R V I E W       

Scenario and Summary 

This lab introduces you to writing a C++ program to implement the concept of class inheritance using different types of bank accounts as a model. In this lab, you will create a base class, called CBankAccount, and two additional classes (each derived from CBankAccount), called CSavingsAccount and CCheckingAccount. You will then test the operations of each class in function main() to simulate the transactions of both a checking account and a savings account.

Deliverables

1.            Submit a single Notepad file containing the source code for all the files of the lab to the Dropbox for Week 3. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name: for example, YourLastName_Lab3.txt.

 

Each program should include a comment section that includes (minimally) your name, the lab and exercise number, and a description of what the program accomplishes.

2.            Submit a lab report (a Word document) containing the following information to the Dropbox for Week 3.

o             Include your name and the lab or lab-exercise number.

o             Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.

o             Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results.

o             Summary and Conclusions: Includea summary of what the lab demonstrated and any conclusions drawn from the testing of the lab program.

o             Provide a UML diagram showing the base and the derived class relationships, access specifiers, data types, and function arguments.

o             Answers to Lab Questions: Answer any and all of the lab questions included in the lab steps.

Summary: Write a statement summarizing your predicted and actual output. Identify and explain any differences.

Conclusions: Write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solved it or, if you had no significant problems, something you learned by doing the exercise.

Each lab exercise should have a separate section in the lab-report document.

Your lab grade is based upon

1.            the formatting of your source code;

2.            the use of meaningful identifiers;

3.            the extent of internal documentation;

4.            the degree to which an exercises’ specifications are met; and

5.            the completeness of your lab report.

i L A B S T E P S    

STEP 1: Create the Multifile Project and the Main (Base) Class   

Create a new project that consists of the base class BankAccount.

The BankAccount class should contain, at minimum, the following members.

1.            It should contain data members to store a bank customer's balance and account number. These should be of different and appropriate data types.

2.            It should have function members that do the following:

a.            set the account number;

b.            return the account number;

c.             return the account balance;

d.            deposit money into the account; and

e.            withdraw money from the account.

STEP 2: Create the CheckingAccount Class Derived From the BankAccount Class

The class CheckingAccount should contain, at a minimum, the following members.

1.            It should contain a data member to keep track of the number of withdrawal transactions made on the account. Whenever a withdrawal is made, this number should be incremented.

2.            Override the base class, withdraw-money function, and add the capability to deduct transaction fees from an account using the following guidelines.

a.            The checking account is allowed three free transactions. For each successful withdrawal transaction past the three free transactions, there will be a service fee of 50 cents per transaction. The service fee should be deducted from the account balance at the time the transaction is made.

b.            If there are insufficient funds in the account balance to cover the withdrawal plus the service fee, the withdrawal should be denied.

c.             The function should return a value to indicate whether the transaction succeeded or failed. Transaction fees should be deducted only from successful transactions, but the transaction count should be incremented in either case.

STEP 3: Create the SavingsingAccount Class Derived From the BankAccount Class             

The class CheckingAccount should contain, at a minimum, the following members.

1.            It should contain a data member to hold the daily interest rate. The daily interest rate can be calculated from a yearly interest rate by dividing the annual rate by 365.

2.            It should contain a data member to keep track of the number of days since the last transaction or balance inquiry. This should be updated using a random-number generator (reference Lab 1) that will return a value representing the number of days between 0 and 7, inclusive. We will assume that this bank is open every day of the year.

3.            It should contain a data member to hold the interest earned since the last transaction or balance inquiry.

4.            It should contain a function member to set the annual interest rate.

5.            Utilize the base-class functions for both withdrawal and deposit operations for the savings account.

6.            Override the base-class-balance inquiry function to add calculating and adding interest to the account based on the daily interest rate, the current balance of the account, and the number of days since the last balance inquiry. This should be called only when a balance inquiry is made, not when a deposit or withdrawal transaction or an account number inquiry is made.

7.            If there are insufficient funds in the account balance to cover a withdrawal, the withdrawal should be denied. The number of days since the last transaction or balance inquiry and the interest calculations should still be made.

8.            A value should be returned to indicate whether a withdrawal transaction succeeded or failed.

9.            It should contain a function member to return the interest earned since the last transaction or balance inquiry.

10.          It should contain a function member to return the number of days since the last transaction or balance inquiry.

STEP 4: Test Program Operation               

1.            All data-input and data-display operations (cin and cout) should be done in the function main() test program.

2.            The test program should create one checking account and one savings account with initial balances of $100 each using the functions defined in the class definitions. The test program should also assign a unique, five-digit account number to each account and assign an annual interest rate of 3% for the savings account.

3.            The test program should then display a menu that allows the user to select which option is to be performed on which account, including the following.

a.            Make a deposit and specify the amount to a selected or an entered account.

b.            Make a withdrawal and specify the amount to a selected or an entered account.

c.             Return the balance of a selected or an entered account.

i.              For deposit transactions, withdrawal transactions, and balance inquiries, the updated balance and any fees charged or interest earned should also be displayed.

ii.             For the savings account, the number of days since last transaction should be displayed.

d.            Exit the program.

4.            Each account operation should display the account number and the account type.

Lab Questions  

Please answer all the lab questions in the text file that is to be turned into the Dropbox. You are not required to copy the question text into your document, but all answers should be listed with the question number they answer.

1.            Were any base-class functions called or overloaded in either of the derived classes? If so, list which class and which function, and explain why they were either called or overloaded.

2.       &am

Complete solution for COMP220 course in C++ - Visual C++ 2010

It is 100% correct solution - Visual Studio 2010 Projects

If you have more questions, please contact me via email support@extutorials.com, i will help you any time

Thank you

Attached Files

Move over [ preview ] file name to preview content in it!

  • COMP220 All Labs.zip [3343.4KB]
    • COMP220 iLab1
    • COMP220 iLab2
    • COMP220 iLab3
      • BankAccounts
        • Bankaccount.cpp [0.9KB] [ preview ]
        • Bankaccount.h [0.7KB] [ preview ]
        • BankAccountMain.cpp [3.3KB] [ preview ]
        • BankAccounts.vcxproj [4.2KB]
        • BankAccounts.vcxproj.filters [1.5KB]
        • BankAccounts.vcxproj.user [0.1KB]
        • Checkingaccount.cpp [0.7KB] [ preview ]
        • Checkingaccount.h [0.2KB] [ preview ]
        • SavingsAccount.cpp [0.8KB] [ preview ]
        • SavingsAccount.h [0.7KB] [ preview ]
      • BankAccounts.sln [0.9KB]
      • BankAccounts.suo [19.9KB]
      • Debug
    • COMP220 iLab4
      • COMP220 iLab4
        • Capacitor.cpp [0.9KB] [ preview ]
        • Capacitor.h [0.4KB] [ preview ]
        • COMP220 iLab4.vcxproj [4.2KB]
        • COMP220 iLab4.vcxproj.filters [1.5KB]
        • COMP220 iLab4.vcxproj.user [0.1KB]
        • data.txt [0.4KB] [ preview ]
        • Filter.cpp [1.2KB] [ preview ]
        • Filter.h [0.4KB] [ preview ]
        • Resistor.cpp [0.9KB] [ preview ]
        • Resistor.h [0.4KB] [ preview ]
        • TestMain.cpp [0.8KB] [ preview ]
      • COMP220 iLab4.sln [0.9KB]
      • COMP220 iLab4.suo [17.4KB]
    • COMP220 iLab5
      • COMP220 iLab5
        • COMP220 iLab5.vcxproj [4KB]
        • COMP220 iLab5.vcxproj.filters [1.1KB]
        • COMP220 iLab5.vcxproj.user [0.1KB]
        • Resistor.cpp [1KB] [ preview ]
        • Resistor.h [0.4KB] [ preview ]
        • TestMain.cpp [1KB] [ preview ]
      • COMP220 iLab5.sln [0.9KB]
      • COMP220 iLab5.suo [14.3KB]
    • COMP220 iLab6
    • COMP220 iLab7
      • COMP220 iLab7
        • Circle.cpp [0.6KB] [ preview ]
        • Circle.h [0.2KB] [ preview ]
        • COMP220 iLab7.vcxproj [4.1KB]
        • COMP220 iLab7.vcxproj.filters [1.5KB]
        • COMP220 iLab7.vcxproj.user [0.1KB]
        • RectAngle.cpp [0.8KB] [ preview ]
        • RectAngle.h [0.3KB] [ preview ]
        • Shape.cpp [81Bytes] [ preview ]
        • Shape.h [0.1KB] [ preview ]
        • TestMain.cpp [1.1KB] [ preview ]
      • COMP220 iLab7.sln [0.9KB]
      • COMP220 iLab7.suo [18.4KB]

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B