CST-210 5 Dice, 3 Rolls The purpose of this assignment is to assess your ability to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
CST-210 5 Dice, 3 Rolls The purpose of this assignment is to assess your ability to do the following: • Implement a class based on a UML class diagram. • Utilize objects in a software solution. Write a program based on a logical model (flowchart). In this assignment, you will write a program that simulates a dice game. 1. Start by implementing the Die class using the following UML model and data/method descriptions. Die sides : int value: int + Die (int) : + Die(): + roll(): void +getValue(): int //# of sides on the die int sides; //face-value of the die //1<=value<sides int value; //initialize the sides with the parameter //intialize the value to e Die (int); //initialize sides to 6 //initialize value to e Die(); //roll the die and update value void roll(); //return the face-value of the die int getValue(); 2. Next, add a .cpp file to your project. Call this file DiceGame.cpp. This file will contain three functions: main (), a function to showDice (), and a function to get TotalScore (), as shown below. In function main(), create an array of five 6- sided dice. Write a loop that iterates over the array and rolls each die in the array. #include <iostream> #include "Die.h" using namespace std; void showDice (Die[]); int getTotalScore (Die[]); int main() { ... } Function main int getTotalScore (Die theDice[]) { ... } void showDice (Die theDice[]) {... Function headers 3. Write the implementation for the method show Dice (). This method should display the dice in the following format: where the numbers on the top line indicate each die and the numbers on the bottom line indicate the face-value of the corresponding die. Test your method by passing the array of dice, created in main (). C:\Users\Lydia\Source\Rep Implementations 12345 55622 4. Write the code that allows the user to re-roll three times. Use the provided flowchart as a guide. The parts of the flowchart that appear in a rectangle with double lines at the ends are the processes that require additional logical development. start create myDice [5] end roll all the dice false j++ show result of the roll 1:40 3 input numToRo11/ j:40 j<numToRo11? input dieToRo11/ roll indicated die false 1++ show the total score for the roll When you have finished your program, create a 3-to 5-minute video in which you 1. Run your program, 2. Explain the output produced, 3. Discuss the development process, including challenges and how you attempted to resolve them, 4. Tell how your project demonstrates the following assignment objective: "Implement a class based on a UML class diagram." To do this, explain how your class follows the UML diagram. Remember, you are explaining your work and NOT READING YOUR CODE. BEFORE you submit, make sure that • Every file contains your name and statement of own work. • Your code contains procedural comments comments that explain WHAT your programs are doing, as opposed to HOW they are doing it. Submit the following: • A text document titled Links.txt that contains a link to your video. Your source code. CST-210 5 Dice, 3 Rolls The purpose of this assignment is to assess your ability to do the following: • Implement a class based on a UML class diagram. • Utilize objects in a software solution. Write a program based on a logical model (flowchart). In this assignment, you will write a program that simulates a dice game. 1. Start by implementing the Die class using the following UML model and data/method descriptions. Die sides : int value: int + Die (int) : + Die(): + roll(): void +getValue(): int //# of sides on the die int sides; //face-value of the die //1<=value<sides int value; //initialize the sides with the parameter //intialize the value to e Die (int); //initialize sides to 6 //initialize value to e Die(); //roll the die and update value void roll(); //return the face-value of the die int getValue(); 2. Next, add a .cpp file to your project. Call this file DiceGame.cpp. This file will contain three functions: main (), a function to showDice (), and a function to get TotalScore (), as shown below. In function main(), create an array of five 6- sided dice. Write a loop that iterates over the array and rolls each die in the array. #include <iostream> #include "Die.h" using namespace std; void showDice (Die[]); int getTotalScore (Die[]); int main() { ... } Function main int getTotalScore (Die theDice[]) { ... } void showDice (Die theDice[]) {... Function headers 3. Write the implementation for the method show Dice (). This method should display the dice in the following format: where the numbers on the top line indicate each die and the numbers on the bottom line indicate the face-value of the corresponding die. Test your method by passing the array of dice, created in main (). C:\Users\Lydia\Source\Rep Implementations 12345 55622 4. Write the code that allows the user to re-roll three times. Use the provided flowchart as a guide. The parts of the flowchart that appear in a rectangle with double lines at the ends are the processes that require additional logical development. start create myDice [5] end roll all the dice false j++ show result of the roll 1:40 3 input numToRo11/ j:40 j<numToRo11? input dieToRo11/ roll indicated die false 1++ show the total score for the roll When you have finished your program, create a 3-to 5-minute video in which you 1. Run your program, 2. Explain the output produced, 3. Discuss the development process, including challenges and how you attempted to resolve them, 4. Tell how your project demonstrates the following assignment objective: "Implement a class based on a UML class diagram." To do this, explain how your class follows the UML diagram. Remember, you are explaining your work and NOT READING YOUR CODE. BEFORE you submit, make sure that • Every file contains your name and statement of own work. • Your code contains procedural comments comments that explain WHAT your programs are doing, as opposed to HOW they are doing it. Submit the following: • A text document titled Links.txt that contains a link to your video. Your source code.
Expert Answer:
Answer rating: 100% (QA)
Please find the updated Die class and Main class attached below Dieh class Die private int sides int ... View the full answer
Related Book For
Concepts In Federal Taxation
ISBN: 9780324379556
19th Edition
Authors: Kevin E. Murphy, Mark Higgins, Tonya K. Flesher
Posted Date:
Students also viewed these programming questions
-
Zhang incorporated her sole proprietorship by transferring inventory, a building, 100 percent of the corporation's stock. The property transferred to the corporati and adjusted tax bases: FMV...
-
CST-210 Slot Machine Code Analysis The purpose of this assignment is to assess your ability to do the following: Model software objects with UML diagrams (utilize abstraction in software design)....
-
Builder Products, Incorporated, uses the weighted-average method in its process costing system. It manufactures a caulking compound that goes through three processing stages prior to completion....
-
Refer to the consolidated financial statements and notes of Reitmans (Canada) Limited in Appendix A. Instructions (a) Referring to Note 14, what was the long-term total debt (mortgage payable)...
-
The field work for the June 30, 2019, audit of Tracy Brewing Company was finished August 19, 2019, and the completed financial statements, accompanied by the signed audit reports, were mailed...
-
What are some of the connections between the arts and personal identities?
-
As a study aid, your classmate Pascal Adams has prepared the following list of statements about decision-making and incremental analysis. 1. The first step in managements decision-making process is,...
-
When two organizations are merging, it can be a very stressful time for employees. Not only can this impact employees, it can also impact their family and relationships etc. 1. Describe a way in...
-
Executive Transportation Services creates each new budget based on the dollar amounts budgeted in the preceding year. Executive Transportation is using a cash budget zero-base budgeting approach...
-
Take the Jelly Belly plant tour and describe the process used. 1. Is it a continuous, line, batch, job shop, or project form of the process? 2. How much automation is used?...
-
Describe how research and best-practices contribute to the implementation of EBM. Using a real or hypothetical healthcare organization, provide examples of when EBM may be successfully adopted in...
-
As shown in the module resources, the Sarbanes-Oxley Act of 2002 (SOX) has several implications for project management. Describe what you believe is the best use of EVM principle(s) to satisfy SOX...
-
Suppose we wish to set up a production plan for the JC Company for the next six months. We are given the following information: Jan Feb March April May June 22 19 21 21 22 20 2000 1800 1200 1100 1100...
-
Conscious capitalism is reflected in various manners in an organization. How does an organization practice conscious capitalism? How could an organization further its understanding and implementation...
-
Presented below is information related to Dublin Company for 2018. Unrealized gain on non-trading equity securities, net of tax 200,000 Retained earnings balance, January 1, 2018 1,200,000 Sales...
-
Hassad owns a rental house on Lake Tahoe. He uses a real estate firm to screen prospective renters, but he makes the final decision on all rentals. He also is responsible for setting the weekly...
-
Taylor dies on February 19 of the current year. Among the assets in his estate are 500 shares of Dane Company preferred stock. Taylor paid $14 per share for the stock on August 13, 2001. Market...
-
Claude is a CPA and a partner with SKH and Associates, a regional public accounting firm. In September 2009, Brokaw Technologies approached one of his clients, Walter Fenner, about acquiring 100...
-
Consider the following 1. Safety valve 2. Steam trap 3. Steam separator 4. Economiser Among these the boiler accessories would include (a) l, 2 and 3 (b) 2, 3 and 4 (c) l and 4 (d) l, 2, 3 and 4
-
Injector is used in small boilers (a) to inject steam to increase its capacity (b) to inject water like a feed pump (c) to inject air to the furnace (d) none of the above
-
Match List I and List II and select the correct answer using the codes given below the lists List I (Type of boiler) A. Babcock and Wilcox B. Lancashire C. La-mont D. Cochran List II (Classification...
Study smarter with the SolutionInn App