Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Can you suggest alternative strategies for reducing the trust gap?

Answered: 1 week ago

Question

2. Be tactful, but dont avoid talking about tough issues.

Answered: 1 week ago