Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c++ Deliverable: 1) Wame the file containing your C+1source code hw 4 sxock epp; where your owe student iD should roplace the string exxxx Tasks:
c++
Deliverable: 1) Wame the file containing your C+1source code hw 4 sxock epp; where your owe student iD should roplace the string "exxxx" Tasks: The aim of this question is so practiee the usage of tandom numbers and arrays in C++. Blavically, you are avked 10 write a C+ pregram as followes. Declare two arrays of sise 5 . One array will stoee the values of sum of selectice and the secced ase will slore the namber of selvetices. Every clement in the two arnays is calculated as follows: generate randem numbers between 6 and 1 unail their sum exceeds Isthen, share the sum as an elemeat in the firs array. The namber of generaled random rambers for that aum is Alored in the secood array. Foe ecample, if the poseram generaled of the there random numbers) and the first element in the second array will be 3 (number of gaveralod random mambers uetil sum exceods soe-. The proggnam will continue until it stares encemests in cach array. For every elemetn to be shored in the firs artay, display the ecreralcd random namibers as given in the sample suput. Finally, the program displays the corput of the rao arrays. Figure 1 shows a sample ontper of the program 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