Question: MP-1431_Asgmt%20%231.pdf 171 100% Q1. Write a program that simulates the rolling of two dice. The sum of the two values should then be calculated. Your
MP-1431_Asgmt%20%231.pdf 171 100% Q1. Write a program that simulates the rolling of two dice. The sum of the two values should then be calculated. Your program should roll the two dice 36,000,000 times. Use a one-dimensional array to tally the numbers of times each possible sum appears and print it. Also, determine if the totals are reasonable (i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7). (Hint : what is the minimum and maximum sum obtained when you roll a die? Some sums are more frequent than the others.) (10 Points) Q2. Use a vector to read 10 integer numbers, each of which is between 1 and 50. Begin with an empty vector and use its push_back function to add each unique value to the vector. As each number is read, validate it and store it in the array only if it is not a duplicate of a number already read. After reading all the values, display only the unique values that the user entered. (10 Points) Rubrics: Criteris Points (10) Program Requirements 8 Excellent (100%) Meets all requirements and Compiles without any errors Code is clean and well-organized Good Satisfactory (90%) (70%) Program Program oflen functions outputs incorrectly for incorrectly some test inputs Minor issues with Major issues with indentation, indentation variable naming variable naming or organization organization Readability Needs Work to 50%) Program only works in very limited casco not at all No code organization making it hard to od and understand the Logic No com 1 Comments Usclul comments appropriate places Important comments are missing or cessively commented onde Lacking meaningful Comments W 466 ENG US hip
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
