above output shows like this I need to have the same output for the power shell script.
Fantastic news! We've Found the answer you've been seeking!
Question:
above output shows like this
I need to have the same output for the power shell script.
I need the answer as soon as possible plz.
Transcribed Image Text:
Write and test a PowerShell translation of the following program guessing.c. The C code should compile and run as is on either apollo or munro. Develop and hand in the PowerShell equivalent, which will be simpler, with comments. If there is anything you can t implement or does not work then document your problems. //File: guessing.c #include #include #include #include #include int main (int argc, char * argv[], char * { int rnum, guess, counter; srand(time (NULL)); //seed the random # generator rnum=rand () % (60-40+1) + 40; fprintf(stdout, I m thinking of a random # between 40 and 60 ); fprintf(stdout, You have to guess what it is. ); fprintf(stdout, (Hint... the number is: %d) , rnum); counter=0; while (true) { } envp []) counter++; fprintf(stdout, Enter a guess: ); fflush(stdout); fscanf(stdin, %d , &guess); if (guess==rnum) break; if (guess>rnum) fprintf(stdout, Your guess is too high ); else if (guess /tmp/GkngTomQye.o I m thinking of a random # between 40 and 60 You have to guess what it is. (Hint... the number is: 44) Enter a guess: 44 Correct!!! You took 1 guesses Write and test a PowerShell translation of the following program guessing.c. The C code should compile and run as is on either apollo or munro. Develop and hand in the PowerShell equivalent, which will be simpler, with comments. If there is anything you can t implement or does not work then document your problems. //File: guessing.c #include #include #include #include #include int main (int argc, char * argv[], char * { int rnum, guess, counter; srand(time (NULL)); //seed the random # generator rnum=rand () % (60-40+1) + 40; fprintf(stdout, I m thinking of a random # between 40 and 60 ); fprintf(stdout, You have to guess what it is. ); fprintf(stdout, (Hint... the number is: %d) , rnum); counter=0; while (true) { } envp []) counter++; fprintf(stdout, Enter a guess: ); fflush(stdout); fscanf(stdin, %d , &guess); if (guess==rnum) break; if (guess>rnum) fprintf(stdout, Your guess is too high ); else if (guess /tmp/GkngTomQye.o I m thinking of a random # between 40 and 60 You have to guess what it is. (Hint... the number is: 44) Enter a guess: 44 Correct!!! You took 1 guesses
Expert Answer:
Answer rating: 100% (QA)
File guessingps1 Seed the random number generator random NewObject SystemRandom Generate a random nu... View the full answer
Related Book For
Excellence in Business Communication
ISBN: 978-0136103769
9th edition
Authors: John V. Thill, Courtland L. Bovee
Posted Date:
Students also viewed these programming questions
-
9. Suppose we are solving for Arb with A E Rmxn being rank deficient (minimum norm solution) (a) For b(A) why wouldn't the solution (ATA)-Ab work? (b) Suppose beR(A). Show that the error vector is...
-
Example #1 (Z +, ) is Subring (RT), (0) sub ring (R +)
-
Given the sprinkler system layout in Figure A, calculate the flow and pressure required at point RN#1 (point B in Figure B) without considering the impact of velocity pressures. Note that RN#1 (point...
-
Israel We I had been in Israel for two weeks. We were in our church tour bus, late at night, driving through the mountainous desert. The night was black no moon and only a few stars. The only light...
-
Identify the fundamental distinction between a futures contract and an option contract, and briefly explain the difference in the manner that futures and options modify portfolio risk.
-
Using Castiglianos theorem and determine the horizontal deflection at C. The cross-sectional area of each member is indicated in the figure. Assume the members are pin connected at their end points....
-
What are the ways that social media sites are affecting courtrooms?
-
Cash Flow Intuition A project has an initial cost of 1, has required return of R, and pays C annually for N years. a. Find C in terms of l and N such that the project has a payback period just equal...
-
Describe one brand that you like the most. Connecting to what we have learned about the symbolic meaning of consumption, please explain the symbolic meanings you believe the brand has, and how this...
-
LUKE'S GENERAL STORE Inventory December 31, 20X7 Price Test Results Proper Action (select one): Test Test Count Item Description Auditor Notes (last purchased Item# Results: price): Boxes appear...
-
A company has a net income of $ 4 5 , 0 0 0 . Accounts receivable increased by $ 3 0 0 0 and inventory decreased by $ 5 0 0 0 over the financial year. Accounts payable increased by $ 3 0 0 0 over the...
-
Effect of Below Market Financing on Property Prices - Assume that a property's cash market value is $500,000 today. The current market based financing is a 5% interest rate with a 20-year term with...
-
Sales revenue $470,800.00 Cost of goods sold 217,766.40 Gross margin $253,033.60 Less: Selling expenses 86,199.20 Administrative expenses 74,942.80 Operating income $91,891.60 What was the sales...
-
In anticipation of Digby Corporation's new product, Dash, the company will purchase new plant and equipment for $12,750,000. The plant and equipment is expected to be used for 15 years and has a...
-
5. A galaxy emits light with a frequency of 5.45 1014 Hz. (a) What color is this, approximately? (b) We observe this galaxy at a wavelength of 520 nm. How fast is it moving away from us?
-
What are data analytics? What is it used for? How do accountants use data analytics? What are some tools that can be used for data analytics in accounting? What are data visualizations? How are they...
-
5. Explain how a government budget deficit might crowd out private investment.
-
Suppose that a business sells 6-month subscriptions to its monthly magazine. On January 1, the company receives a total of $600 for 10 subscriptions. To record this transaction, the company debits...
-
With a team of fellow students, your challenge is to identify opportunities to increase sales of poetry-any kind of poetry, in any medium. The following suggestions may help you get started: ...
-
In a section that discusses the history of AMG from its founding as a manufacturer of race car engines, the Mercedes-AMG website includes the following sentence: "The technology transfer from the...
-
A wide variety of people visit the foundation's website, from researchers who are interested in applying for grants to reporters writing about health and education issues to members of the general...
-
Provide an example of two samples that are independent. Explain why these samples are independent.
-
Why is it necessary for all values in the confidence interval to be positive to conclude that 1 > 2? What would have to be true to conclude that 1 < 2?
-
Provide an example of two samples that are paired. Explain why these samples are paired.
Study smarter with the SolutionInn App