Question
c++ Given integer variables seedVal and highestInput, seed the pseudorandom number generator with seedVal. Then, generate four random numbers in the range 1 to highestInput
c++
Given integer variables seedVal and highestInput, seed the pseudorandom number generator with seedVal. Then, generate four random numbers in the range 1 to highestInput and output an equation of the form "A - B * C + D = X", where A, B, C, and D are the randomly generated numbers, and X is the solution to the equation. End with a newline.
Ex: If highestInput is 9, then a possible output is:
5 - 8 * 4 + 3 = -24
Note: srand() should be called only once at the start.
#include
int main() { int seedVal; int highestInput; int A; int B; int C; int D;
cin >> seedVal; cin >> highestInput; /* Your code goes here */ return 0; }
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