Question

Can someone let me know what to do for this? In C Programming.

HERE ARE INSTRUCTIONS:

Update function displayScoreCard to do the following a. Declare local variable total set equal to the result from function ca

This is my code for that specific section:


void displayScoreCard(int scoreCard[CATEGORIES][COLS])
{

printf("\n\n\t\tYAHTZEE SCORECARD\n");

displayUpperSection(scoreCard);

displayLowerSection(scoreCard);
printf("\t\t+-------------+-------------+\n\n");

printf("+-----------------|-----------|\n");
printf("+ TOTAL (Upper) | %d |\n", ZERO);
printf("+-----------------|-----------|\n");
printf("+ GRAND TOTAL | %d |\n", ZERO);
printf("+-----------------|-----------|\n\n\n");

}

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

The given method after the required changes is given below:

void displayScoreCard(int scoreCard[CATEGORIES][COLS])
{
//variable declaration and initialization
int total = sumUpper(scoreCard) + checkBonus(scoreCard);
  
//variable declaration and initialization
int grandTotal = total + sumLower(scoreCard);
  
printf("\n\n\t\tYAHTZEE SCORECARD\n");
  
displayUpperSection(scoreCard);
  
displayLowerSection(scoreCard);
printf("\t\t+-------------+-------------+\n\n");
  
printf("+-----------------|-----------|\n");
printf("+ TOTAL (Upper) | %d |\n", total);
printf("+-----------------|-----------|\n");
printf("+ GRAND TOTAL | %d |\n", grandTotal);
printf("+-----------------|-----------|\n\n\n");
}

The screenshot of the above method is given below:

Add a comment
Know the answer?
Add Answer to:
Can someone let me know what to do for this? In C Programming. HERE ARE INSTRUCTIONS:...
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
  • Can someone let me know what to do for this? In C Programming. HERE ARE INSTRUCTIONS:...

    Can someone let me know what to do for this? In C Programming. HERE ARE INSTRUCTIONS: Here is my code I have that needs to be edited with instructions. : void displayUpperSection(int scoreCard[CATEGORIES][COLS]){ printf("+-----------------|-----------|\n"); printf("+ UPPER SECTION | SCORE |\n"); printf("+-----------------|-----------|\n"); printf("+ ONEs | %d |\n", scoreCard[one][COL]); printf("+-----------------|-----------|\n"); printf("+ TWOS | %d |\n", scoreCard[two][COL]); printf("+-----------------|-----------|\n"); printf("+ THREES | %d |\n", scoreCard[three][COL]); printf("+-----------------|-----------|\n"); printf("+ FOURS | %d |\n", scoreCard[four][COL]); printf("+-----------------|-----------|\n"); printf("+ FIVES | %d |\n", scoreCard[five][COL]); printf("+-----------------|-----------|\n"); printf("+ SIXES | %d...

  • Can someone let me know what to do for this? In C Programming. HERE ARE INSTRUCTIONS:...

    Can someone let me know what to do for this? In C Programming. HERE ARE INSTRUCTIONS: it is for a yahtzee game program. Write function sumChance to do the following a. Return type int b. Parameter list array of dice c. Declare int variable sum d. Declare int variable die e. Loop through the dice array adding the value of each die to the variable sum f. Return variable sum Write function checkLgStraight to do the following a. Return type...

  • Can someone let me know what to do for this? In C Programming. HERE ARE INSTRUCTIONS:...

    Can someone let me know what to do for this? In C Programming. HERE ARE INSTRUCTIONS: Write function sum Category to do the following a. Return type int b. Parameter list i. int array dice ii. int value category c. Declare int variable sum d. Declare int variable die e. Loop through the dice array i. Based on the selected category check if the value of the current die matches the category (i.e. user selected ONE for category, die value...

  • Hi, I need help with this question to my coding assignment. I completed letter A in...

    Hi, I need help with this question to my coding assignment. I completed letter A in the remaining program I just need help with letter "B" and by the way this is C programming. If you can't do it, just explain to me in very simple terms what I would do. void updateScores(int scoreCard[CATEGORIES][COLS], int category,int dice [5]) { switch(category) { case ONE: printf("Scoring Ones...\n"); break; case TWO: printf("Scoring Twos...\n"); break; case THREE: printf("Scoring Threes...\n"); break; case FOUR: printf("Scoring Fours...\n");...

  • Help with a Parallel and Distributed Programming assignment. In this assignment, you will be expl...

    Help with a Parallel and Distributed Programming assignment. In this assignment, you will be exploring different methods of counting the prime numbers between 1 and N. You will use 8 threads, and each will be given a range in which to count primes. The question is: where do you store your counter? Do you use a local variable? Do you use a global variable? Please use the following function to determine whether an integer number is a prime. // Return...

  • Note: The question needs to be answered in "C Programming Languange ". And after the question fin...

    Note: The question needs to be answered in "C Programming Languange ". And after the question find 3 pages for needed informations. Spring CE4717 Language Processors Q1. Consider the following LEx program. return R1 return R2 return R3 return R4 return R5; return R6; IA-2a-z)[A-Za-z0-9]- -2 10-91+ 10-9a-EA-FI Ihi] [01] [01] 이삐 t Vtin) int main (void) int tcode; do f tcode -yylex()i printf ("token type td \"%s\"\n", tcode, yytext); ) while (tcode)i return 0; i. Explain the steps needed...

  • C Programming write two functions, similar to what you see in the sample program. The first will ask the user to enter some information (I have included the type in parentheses) First Name (char[]) L...

    C Programming write two functions, similar to what you see in the sample program. The first will ask the user to enter some information (I have included the type in parentheses) First Name (char[]) Last Name (char[]) Age (int) Height in Inches (double) Weight in Pounds (double) You will use pass-by-reference to modify the values of the arguments passed in from the main(). Remember that arrays require no special notation, as they are passed by reference automatically, but the other...

  • Please use Visual Studio! Let me know if you need anything else <3 #include <stdio.h> #include...

    Please use Visual Studio! Let me know if you need anything else <3 #include <stdio.h> #include <string.h> #pragma warning(disable : 4996) // compiler directive for Visual Studio only // Read before you start: // You are given a partially complete program. Complete the functions in order for this program to work successfully. // All instructions are given above the required functions, please read them and follow them carefully. // You shoud not modify the function return types or parameters. //...

  • This is a C++ probelm, I am really struggling with that...... Can anyone help me?? Write...

    This is a C++ probelm, I am really struggling with that...... Can anyone help me?? Write a fraction class whose objects will represent fractions. For this assignment you aren't required to reduce your fractions. You should provide the following member functions: A set() operation that takes two integer arguments, a numerator and a denominator, and sets the calling object accordingly. Arithmetic operations that add, subtract, multiply, and divide fractions. These should be implemented as value returning functions that return a...

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