Answered step by step
Verified Expert Solution
Question
1 Approved Answer
answer questions above - Wplnad your source code files ONL.Y in cpp or h furmat. - Avoid copying/ pasting your code into a text file
answer questions above
- Wplnad your source code files ONL.Y in cpp or h furmat. - Avoid copying/ pasting your code into a text file or other file formats. - Limit sincludes statements to those contained in the C++ standard library, Any headers that you create and include in your code must be a part of your submission. - Double-theck that your conde compiles before suhmitting. Y'u will lose points fur campilatian error even if your lngic is correct. Q1. Write a program that simulates the rolling of two dice. The sum of the two values should then be calculated. Yow program should roll the two dice 36,000,000 times. Use a one-dimensiomal arryy to tally the numbers of times each possihle sum ipppears and print it. Also, determine if the totals are reasonable (i,e, there are six ways to roll a 7, so approximately ane-sixth of all the rolls should be 7 ). [Hint: what is the minimum and maximun 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 am emply vector and use its push_bock function ta add each unique value to the vector. As cach number is read, validate it and store it in the array naly if it is not a duplicate of a number already read. After readiog all the values, display only the unique values that the user entered. (10 Points)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started