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
-
A vessel of volume V = 20 1 contains a mixture of hydrogen and helium at a temperature t = 20 C and pressure p = 2.0 atm. The mass of the mixture is equal to m = 5.0 g. Find the ratio of the mass of...
-
On March 31, 2024, Chow Brothers, Incorporated, bought 5% of KT Manufacturing's capital stock for $56.0 million. KT's net income for the year ended December 31, 2024, was $82.0 million. The fair...
-
In Example 3.1, we see that \(27.5 \%\) of US adults are college graduates. (a) Use StatKey or other technology to generate a sampling distribution for the sample proportion of college graduates...
-
Comprehensive Income Armstrong Corporation reported the following for 2010: net sales $1,200,000 cost of goods sold $720,000: selling and administrative expenses $320,000: and an unrealized holding...
-
Accounts Debit Credit Cash $24,100 Accounts Receivable 5,500 Supplies 3,400 Land 53,000 Accounts Payable $3,500 Common Stock 68,000 Retained Earnings 14,500 Totals $86,000 $86,000 During January...
-
Modify the sentence-generator program of Case Study so that it inputs its vocabulary from a set of text files at startup. The filenames are nouns.txt, verbs. txt, articles.txt, and prepositions.txt....
-
Maddie Chyz manages True Grit Enterprises. As of June 31, 2023 True Grit has account balances of: Cash A/R Supplies $ 29,800 2,450 850 A/P $ 4,200 N/P 6,000 Stock $1 par 5,000 Retained Earnings 7,800...
-
Repeat problem 9.b to produce a goal-driven solution. Data from problem 9.b b. Generate the state space and stages of working memory for the data-driven solution to the example in Chapter 3.
-
Solve the problem using direct substitution method Maximize $f=3 x_{1}^{2}+2 x_{2}^{2}$ subject to the constraints \[x_{1}+3 x_{2}=5\]
-
When fractional factorial design is useful?
-
What is the difference between an initial value problem and a final value problem?
-
What is meant by expected value of any random variable?
-
Towns A and B are located near a straight river as shown in Figure 1 (not drawn to scale). A pumping station is to be built on the river's edge with pipes extending straight to the two towns. Your...
-
Integration is a vital concept when applied in one?s life. Integrating your life means making ideal choices. Perfect choices on the other go in line with quality decisions. Quality decisions lead to...
-
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)...
-
Consider an experiment that selects a cell phone camera and records the recycle time of a flash (the time taken to ready the camera for another flash). The possible values for this time depend on the...
-
Suppose that the recycle times of two cameras are recorded. The extension of the positive real line \(R\) is to take the sample space to be the positive quadrant of the plane \[ S=R^{+} \times R^{+}...
-
As in Example 2.1, camera recycle times might use the sample space \(S=R^{+}\), the set of positive real numbers. Let \[ E_{1}=\{x \mid 10 \leq x <12\} \quad \text { and } \quad E_{2}=\{x \mid 11 0\}...
Study smarter with the SolutionInn App