1

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

Question

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");
break;
case FIVE:
printf("Scoring Fives...\n");
break;
case SIX:
printf("Scoring Sixes...\n");
break;
case THREEKIND:
printf("Scoring Three of a Kind...\n");
break;
case FOURKIND:
printf("Scoring Four of a Kind...\n");
break;
case FULLHOUSE:
printf("Scoring Full House...\n");
break;
case SMSTRAIGHT:
printf("Scoring Small Straight...\n");
break;
case LGSTRAIGHT:
printf("Scoring Large Straight...\n");
break;
case YAHTZEE:
printf("Scoring Yahtzee...\n");
break;
case CHANCE:
printf("Scoring Chance...\n");
break;
default:
printf("Invalid option, try again\n");
break;
}
}5. Update function updateScores to do the following + Add a third parameter in the function definition i int array named dice

5. Update function updateScores to do the following + Add a third parameter in the function definition i int array named dice with size of five b. Case labels ONE through SIX should include the following i. Set the score in array scoreCard for the associated row equal to function call sumCategory passing arguments 1. dice 2. category ii. The remaining case labels should set the score in array scoreCard to the associated function call for the category

Answers

I have updated the code. You need to implement the functions sumCategory(), sumChance(), checkFourKind(), checkThreeKind(), checkFullHouse(), checkLgStraight(), checkSmStraight(), checkYahtzee() for the following code to work


void updateScores(int scoreCard[CATEGORIES][COLS], int category,int dice [DICE])
{
   switch(category)
   {
   case ONE:
       printf("Scoring Ones...\n");
       scoreCard[one][COL] = sumCategory(dice, category);
       break;
       break;
   case TWO:
       printf("Scoring Twos...\n");
       scoreCard[two][COL] = sumCategory(dice, category);
       break;
   case THREE:
       printf("Scoring Threes...\n");
       scoreCard[three][COL] = sumCategory(dice, category);
       break;
   case FOUR:
       printf("Scoring Fours...\n");
       scoreCard[four][COL] = sumCategory(dice, category);
       break;
   case FIVE:
       printf("Scoring Fives...\n");
       scoreCard[five][COL] = sumCategory(dice, category);
       break;
      
   case SIX:
       printf("Scoring Sixes...\n");
       scoreCard[six][COL] = sumCategory(dice, category);
       break;
   case THREEKIND:
       printf("Scoring Three of a Kind...\n");
       scoreCard[threekind][COL] = checkThreeKind(dice);
       break;
   case FOURKIND:
       printf("Scoring Four of a Kind...\n");
       scoreCard[fourkind][COL] = checkFourKind(dice);
       break;
   case FULLHOUSE:
       printf("Scoring Full House...\n");
       scoreCard[fullhouse][COL] = checkFullHouse(dice);
       break;
   case SMSTRAIGHT:
       printf("Scoring Small Straight...\n");
       scoreCard[smstraight][COL] = checkSmStraight(dice);

       break;
   case LGSTRAIGHT:
       printf("Scoring Large Straight...\n");
       scoreCard[lgstraight][COL] = checkLgStraight(dice);
       break;
   case YAHTZEE:
       printf("Scoring Yahtzee...\n");
       scoreCard[yahtzee][COL] = checkYahtzee(dice);

       break;
   case CHANCE:
       printf("Scoring Chance...\n");
       scoreCard[chance][COL] = sumChance(dice);
       break;
   default:
       printf("Invalid option, try again\n");
       break;
}


Similar Solved Questions

2 answers
How long would a day be in seconds if the Earth were rotating so fast that objects at the equator were apparently weightless
How long would a day be in seconds if the Earth were rotating so fast that objects at the equator were apparently weightless?...
1 answers
(7 points) 8. A tank initially contains 80 L of a solution in which 20 g...
(7 points) 8. A tank initially contains 80 L of a solution in which 20 g of salt is dissolved. A solution with a salt concentration of 2 g/L is added at a rate of 5 L/min. The solution is kept well mixed and is drained from the tank at a rate of 3 L/min. Find the concentration of the solution in the...
1 answers
CASE 6–29 Variable and Absorption Costing Unit Product Costs and Income Statements O’Brien Company manufactures and...
CASE 6–29 Variable and Absorption Costing Unit Product Costs and Income Statements O’Brien Company manufactures and sells one product. The following information pertains to each of the company’s first three years of operations: Variable cost per unit: Manufacturing Di...
1 answers
Rank the following compounds in order of increasing heat of hydrogenation. A B D E OB<C<E<A<D...
Rank the following compounds in order of increasing heat of hydrogenation. A B D E OB<C<E<A<D OD A<E<C<B OB«E<C<A<D O E<B<C<A<D O DA<C<<...
1 answers
1. Does the following Lewis structure represent an anion, a cation, or a molecule? if it...
1. Does the following Lewis structure represent an anion, a cation, or a molecule? if it represents an ion, what is the charge on the ion?...
1 answers
#1 Create two AVL trees with 7 keys: A, B, C, D, E, F, and G....
#1 Create two AVL trees with 7 keys: A, B, C, D, E, F, and G. (There are 5,040 different key sequences that produce 429 unique trees. Of those trees, 17 are AVL trees.) a. Draw the shortest AVL tree containing these 7 keys. b. Draw one of the tallest possible AVL trees containing these 7 keys....
1 answers
On January 1, 2019, Rodgers Company purchased $100,000 face value, 9%, 3-year bonds for $97,462.11, a...
On January 1, 2019, Rodgers Company purchased $100,000 face value, 9%, 3-year bonds for $97,462.11, a price that yields a 10% effective annual interest rate. The bonds pay interest semiannually on June 30 and December 31. Required: 1. Record the purchase of the bonds. 2. Prepare an inves...
1 answers
Is this molecule acidic or basic?
A)Metronidazole B) Which group will more readily undergo hydrolysis-ester or carbonate if they are in the same molecule?...
1 answers
A child is on a carousel. At what point on the carousel will the child have...
A child is on a carousel. At what point on the carousel will the child have the greatest possible linear velocity? A. At the center B. At a point midway between the center and the edge C. At the outer edge D. The linear speed is equal at all points...
1 answers
How do you express #cos theta - sec theta + cot theta # in terms of #sin theta #?
How do you express #cos theta - sec theta + cot theta # in terms of #sin theta #?...
1 answers
The Bigbee Bottling Company is contemplating the replacement of one of its bottling machines with a...
The Bigbee Bottling Company is contemplating the replacement of one of its bottling machines with a newer and more efficient one. The old machine has a book value of $600,000 and a remaining useful life of 5 years. The firm does not expect to realize any return from scrapping the old machine in 5...
1 answers
Internet of things (IOT) plz answer me this question AS IL CORPO M C. COI POD...
internet of things (IOT) plz answer me this question AS IL CORPO M C. COI POD between emplate more (4 Mar (CZ, COI POI e) Dist Two () yerences between proceed to give ONE() examples for each e t the d type Sara nda (4 Mark Murt)...
1 answers
A forklift will last for only 3 more years. It costs $6,700 a year to maintain....
A forklift will last for only 3 more years. It costs $6,700 a year to maintain. For $22,000 you can buy a new lift that can last for 12 years and should require maintenance costs of only $3,700 a year. a-1. Calculate the equivalent cost of owning and operating the forklift if the discount rate i...
1 answers
What is thw magnitude of the electri force on the +1.00 microcouloumb charge due to the...
what is thw magnitude of the electri force on the +1.00 microcouloumb charge due to the other two charges? Check my w Required information Three point charges are fixed in place in a right triangle, as shown in the figure. +0.800uC -0.600C +1.00pC where y 8.10 cm and z 9.40 cm What is the magnit...
1 answers
Are healthcare providers generally either price takers or price setters exclusively? Explain your answer. Describe two...
Are healthcare providers generally either price takers or price setters exclusively? Explain your answer. Describe two common pricing strategies used by price setters and their implications for financial survivability. Why does utilization management play such an important role in pricing and servic...
1 answers
Draw the expected IR for the following two molecules. Label each peak by functional group нал...
Draw the expected IR for the following two molecules. Label each peak by functional group нал 3800 3600 3400 3200 3000 2800 2200 1800 1600 1400 1200 1000 3800 3600 3400 3200 3000 2800 2200 1800 1600 1400 1200 1000...
1 answers
CONCEPTUAL CHECKPOINT 13.10 Predict the products for each of the following reactions O Excess oExcess Excess...
CONCEPTUAL CHECKPOINT 13.10 Predict the products for each of the following reactions O Excess oExcess Excess HBr Heat HI Heat HBr Heat O Excess Excess HI Heat Excess HI Heat HBr Heat...

-- 0.011586--