2. Using Flowgorithm to Design Conditionals and Iterations In this lab, you will be provided with...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. Using Flowgorithm to Design Conditionals and Iterations In this lab, you will be provided with minimal guidance. You learned a lot about Flogorithm and how to use it to design simple algorithms. You also designed multiple functions in lab 2 using Flowgorithm. This lab will allow you to explore more about the flowgorithm, and you will learn and substantiate your knowledge of functions, conditional statements, and looping. 3. Number Guessing Game Using Flowgorithm a. Develop a function called randomNumber that takes one integer variable n and returns a random number between 1 and n. The Random function is a built-in function in Flowgorithm that returns a random integer value between 0 and n. b. Test your function is working properly by calling it in the Main and running it a few times. c. Develop another function called get PlayerChoise that will prompt the user to enter a number, get it, and returns it. d. Implement the Game Rule in the Main. If the player number is less than the computer number (random number), ask the player to guess higher. If the player number exceeds the computer number, ask the user to guess lower. If the player number equals the computer number, the user wins. Declare winning and exit the game. The game should continue to run for as many times as half of n. If the user did get the number by the end of the run, they lost it. Declare losing and exit the game. 2. Using Flowgorithm to Design Conditionals and Iterations In this lab, you will be provided with minimal guidance. You learned a lot about Flogorithm and how to use it to design simple algorithms. You also designed multiple functions in lab 2 using Flowgorithm. This lab will allow you to explore more about the flowgorithm, and you will learn and substantiate your knowledge of functions, conditional statements, and looping. 3. Number Guessing Game Using Flowgorithm a. Develop a function called randomNumber that takes one integer variable n and returns a random number between 1 and n. The Random function is a built-in function in Flowgorithm that returns a random integer value between 0 and n. b. Test your function is working properly by calling it in the Main and running it a few times. c. Develop another function called get PlayerChoise that will prompt the user to enter a number, get it, and returns it. d. Implement the Game Rule in the Main. If the player number is less than the computer number (random number), ask the player to guess higher. If the player number exceeds the computer number, ask the user to guess lower. If the player number equals the computer number, the user wins. Declare winning and exit the game. The game should continue to run for as many times as half of n. If the user did get the number by the end of the run, they lost it. Declare losing and exit the game.
Expert Answer:
Related Book For
Auditing A Practical Approach
ISBN: 9780730382645
4th Edition
Authors: Robyn Moroney, Fiona Campbell, Jane Hamilton
Posted Date:
Students also viewed these programming questions
-
What is the correlation between stocks X and Z? State of the Economy Probability of Occurrence Stock X Expected Return Stock Y Expected Return Stock Z Expected Return Recession 35% 25% -10% 15%...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Macheso was employed on a three-year contract as an administration manager for Magocha Plc. Machesos employment contract for the three years only provided for an annual salary of P650,000 and an...
-
1Describe in a simplified manner the flow of information from gene to protein
-
An airplane has a mass of 5000 kg, a maximum thrust of 7000 N, and a rectangular wing with aspect ratio 6.0. It takes off at sea level with a 60 split flap as in Fig. 7.25. Assume all lift and drag...
-
Oil is leaking at the rate of V' (t) = 1 - t/110 from a storage tank that is initially full of 55 gallons. How much leaks out during the first hour? During the tenth hour how long until the entire...
-
In a simple vapour compression cycle, the refrigerant is in the form of dry saturated vapour before entering (a) condenser (b) evaporator (c) throttle valve (d) compressor
-
In the Malthusian model, suppose that there is a technological advance that reduces death rates. Using diagrams determine the effects of this in the long-run steady state and explain your results.
-
How do advanced computational fluid dynamics (CFD) simulations contribute to the design and optimization of absorption equipment, particularly in assessing flow distribution and predicting...
-
Coverall Inc. produces and sells a unique type of case for a standard size tablet computer that is guaranteed waterproof but still allows for regular functionality of the tablet. The company has just...
-
With reference to the article "Are audit partners' compensation and audit quality related to their consulting revenue? by by Che, L., Langli, J.C., Svanstrom, T 2021, determine the following: What is...
-
Write a JavaFX program to display the following graphical user interface (GUI). [30 Points] H 2) (Class Name: MovingFan, Java File Name: MovingFan.java) Write an event-driven program to display the...
-
Use ABAQUS analysis to solve the following problem. The geometry shown is for a heat transfer problem. The boundary conditions are shown in the figure. For this problem you will require to perform a...
-
Create a GUI program to compute tax. The program lets the user select tax status and enter taxable income. It computes the tax based on the table given in the Tax Computation assignment. 2009 U.S....
-
Holton's Nursery has the following amounts listed on their Form 941: (Assume no Section 125 health insurance and that none of the employees had exceeded the Social Security wage base.) 2 Wages, tips,...
-
Evaluate the expression, given functions fand h: f(x) = 3x-1, h(x) = -2x + 3x-1. (3)-- h(-2)
-
A particular computing company finds that its weekly profit, in dollars, from the production and sale of x laptop computers is P(x)= -0.003x^3-0.3x^2+700x-900. Currently the company builds and sells...
-
Write a paper about how diet relates to breast cancer in women study design to use: case control study purpose & rationale the purpose of this final project is to utilize the methods and...
-
Professional behaviour means that members of a profession must: (a) comply with rules and regulations. (b) claim to possess all qualifi cations. (c) question the reputation of accountants who are not...
-
IdealProtect Limited (IdealProtect) has been an audit client of Celestia & Associates (C&A) for the past 15 years. IdealProtect is based in Toowoomba, where it manufactures high-tech armour-plated...
-
When an auditor gathers documentary evidence or physical evidence to support an entry in the clients records, the auditor is gathering evidence to support the: (a) Completeness assertion. (b)...
-
How can you identify a real option in a decision tree?
-
In 2022, Costco Wholesale Corporation had a market capitalization of \($238\) billion, debt of \($6.5\) billion, cash of \($12\) billion, and EBIT of about \($8\) billion. If Costco were to increase...
-
In what circumstances does the real option add value?
Study smarter with the SolutionInn App