Question

void SwapCards (int deck [NCARDS] [NPROPS], int src, int dest 92 93 int tempCard 94 / printf (Swap src $d, dest Sd\n, src,

Please help in answering these questions:

1

Line 92 deck is a calling parameter. The received number of that parameter is what?

copy of original value

pointer

2

Line 92, src is a calling parameter. The received number of that parameter is what?

copy of original value

pointer

3

Line 95 is a debugging technique where the computer prints what it is doing. Give the line number of a similar line in the example

99

101

108

113

4

Line 105, NPROPS is a property defined at the beginning of the program. The value for NPROPS is substituted when the code is compiled. In the homework assignment, what is the original value of NPROPS?

12

52

2

13

5

Lines 92-102 -- how many cell values need to be swapped?

1

2

3

4

6

- What does tempCard do (within whole function)?

protects src value

protects dest value

protects face value

protects suit value

7

Which line uses the column that deals with the face value?

97

101

98

92

8

PrintCard function: what data type is the value for suitvalue?

char pointer

char

int pointer

int

9

PrintCard function: the face array contains what?

Pointers for text strings

Char array

strings

dereference values

10

Line 105: second parameter selects what?

Deck suit text

Card column

Card row

Deck face text

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1 Line 92 deck is a calling parameter. The received number of that parameter is what?

Ans: the deck is a 2d array. it is passed as a pointer.

The received number of that parameter is pointer.

============================================================================================

2 Line 92, src is a calling parameter. The received number of that parameter is what?

Ans: src is a copy of the original value in the received parameter.

============================================================================================

3 Line 95 is a debugging technique where the computer prints what it is doing. Give the line number of a similar line in the example

Ans: debugging is done in line number 113 also.

113 line number is correct answer.

============================================================================================

4 Line 105, NPROPS is a property defined at the beginning of the program. The value for NPROPS is substituted when the code is compiled. In the homework assignment, what is the original value of NPROPS?

Ans: from given printCard() function,

deck[card][0] and deck[card][1] is used.

0 and 1 is value of  NPROPS

2 is correct answer for NPROPS

============================================================================================

\

Add a comment
Know the answer?
Add Answer to:
Please help in answering these questions: 1 Line 92 deck is a calling parameter. The received...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Need help with shuffle function and give 8 cards to user and computer from shuffle deck?...

    Need help with shuffle function and give 8 cards to user and computer from shuffle deck? #include <stdio.h> #include <stdbool.h> #include <string.h> #include <stdlib.h> #include <math.h> #include <time.h> typedef struct card_s{     char suit;     int face;     struct card_s *listp; } card; void card_create(card* thisNode, char cardSuit, int cardFace, card* nextLoc) {     thisNode->suit = cardSuit;     thisNode->face = cardFace;     thisNode->listp = nextLoc;     return; } void card_insertAfter(card* thisNode, card* newNode) {     card* tmpNext = NULL;    ...

  • The following program simulates shuffling a deck of cards. (The line numbers are not ) part of the code). Without changing its functionality, rewrite the program by replacing the 2D array card [5...

    The following program simulates shuffling a deck of cards. (The line numbers are not ) part of the code). Without changing its functionality, rewrite the program by replacing the 2D array card [52] [2] with a double pointer char **card and replacing the code between line 12 and line 26 with a function. The function prototype could be void shuffleCards (char **, char [, char [) 1 7/Shuffling cards 2 4 using namespace std; 6 main() #include #include <cstdlib> <iostream>...

  • Please answer problem #5 thank you str.c #include "str.h" #include <stdio.h> int str_len(...

    Please answer problem #5 thank you str.c #include "str.h" #include <stdio.h> int str_len(char *s) {    /* this is here so code compiles */ return 0; } /* array version */ /* concantenate t to the end of s; s must be big enough */ void str_cat(char s[], char t[]) {    int i, j;    i = j = 0;    while (s[i] != '\0')    /* find end of s */        i++;    while ((s[i++] = t[j++]) != '\0') /* copy t */        ;...

  • 7.12 (Card Shuffling and Dealing) Modify the program in Fig. 7.24 so that the card-dealing function deals a five-card...

    7.12 (Card Shuffling and Dealing) Modify the program in Fig. 7.24 so that the card-dealing function deals a five-card poker hand. Then write the following additional functions: a) Determine whether the hand contains a pair. b) Determinewhetherthehandcontainstwopairs. c) Determine whether the hand contains three of a kind (e.g., three jacks). d) Determinewhetherthehandcontainsfourofakind(e.g.,fouraces). e) Determine whether the hand contains a flush (i.e., all five cards of the same suit). f) Determine whether the hand contains a straight (i.e., five cards of...

  • (Card Shuffling and Dealing) Modify the program below so that the card-dealing function deals a five-card...

    (Card Shuffling and Dealing) Modify the program below so that the card-dealing function deals a five-card poker hand. Then write the following additional functions: a) Determine whether the hand contains two pairs b) Determine whether the hand contains a full house (i.e., three of a kind with pair). c) Determinewhetherthehandcontainsastraight flush (i.e.,fivecardsofconsecutivefacevalues). d) Determine whether the hand contains a flush (i.e., five of the same suit) #include <stdio.h> #include <stdlib.h> #include <time.h> #define SUITS 4 #define FACES 13 #define CARDS...

  • Please help in answering these questions dealing with this one prompt: 1 Which line is first...

    Please help in answering these questions dealing with this one prompt: 1 Which line is first line of the date structure prototype (blueprint)? 30 21 7 59 2 Which line is date structure declared inside another structure prototype? 21 32 36 60 3 What is the structure tag which has date as a data member? date him student her 4 Which line is a student structure instance declared (created)? 17 30 25 55 5 Which line is a student structure...

  • //main.cpp #include <iostream> #include <iomanip> #include "deck-of-cards.hpp" void RunAllTests() { int count; std::cin >> count; DeckOfCards...

    //main.cpp #include <iostream> #include <iomanip> #include "deck-of-cards.hpp" void RunAllTests() { int count; std::cin >> count; DeckOfCards myDeckOfCards; for (int i = 0; myDeckOfCards.moreCards() && i < count; ++i) { std::cout << std::left << std::setw(19) << myDeckOfCards.dealCard().toString(); if (i % 4 == 3) std::cout << std::endl; } } int main() { RunAllTests(); return 0; } //card.hpp #ifndef CARD_HPP_ #define CARD_HPP_ #include <string> class Card { public: static const int totalFaces = 13; static const int totalSuits = 4; Card(int cardFace, int...

  • C Programming The following code creates a deck of cards, shuffles it, and deals to players....

    C Programming The following code creates a deck of cards, shuffles it, and deals to players. This program receives command line input [1-13] for number of players and command line input [1-13] for number of cards. Please modify this code to deal cards in a poker game. Command line input must accept [2-10] players and [5] cards only per player. Please validate input. Then, display the sorted hands, and then display the sorted hands - labeling each hand with its...

  • Deck of Cards Program I need help printing a flush, which is showing the top 5...

    Deck of Cards Program I need help printing a flush, which is showing the top 5 cards of the same suite. Below is the code I already have that answers other objectives, such as dealing the cards, and finding pairs. Towards the end I have attempted printing a flush, but I cannot figure it out. public class Shuffler {    /**    * The number of consecutive shuffle steps to be performed in each call    * to each sorting...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT