4.) Write a RAPTOR program that asks the user to enter five numbers and then outputs...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4.) Write a RAPTOR program that asks the user to enter five numbers and then outputs the largest number that the user entered. This time, use a loop to read the numbers. Hint: To solve this problem, you'll need a variable to keep track of the largest number so far. You might call the variable largestSoFar. Each time you read a new number from the user, check if that number is larger than the largest SoFar (using a Selection symbol), and, if it is, update that you have found a new largest SoFar. Sample run (user input in blue, master console output shown in orange): Enter a number: 10 Enter a number: 12 Enter a number: 3 Enter a number: 42 Enter a number: 12 The largest number was 42 4.) Write a RAPTOR program that asks the user to enter five numbers and then outputs the largest number that the user entered. This time, use a loop to read the numbers. Hint: To solve this problem, you'll need a variable to keep track of the largest number so far. You might call the variable largestSoFar. Each time you read a new number from the user, check if that number is larger than the largest SoFar (using a Selection symbol), and, if it is, update that you have found a new largest SoFar. Sample run (user input in blue, master console output shown in orange): Enter a number: 10 Enter a number: 12 Enter a number: 3 Enter a number: 42 Enter a number: 12 The largest number was 42
Expert Answer:
Answer rating: 100% (QA)
To achieve this in RAPTOR programming tool you can use the following algorithm 1 Initialize a var... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
A regular language is a language that can be defined by a regular expression. 0 2 . 1 Complete the unshaded cells of Table 1 to show which of the statements about regular languages are true and which...
-
Prepare a personal SWOT analysis (Your personal Strengths and Weaknesses and the external macroeconomic Opportunities and Threats that all of your competitors will assess criteria examples Advantages...
-
What is the index of LEI, and how are the indicators in the index chosen? Is the index a good predictor of future economic activity?
-
Analysis of non-financial performance. Use annual report(s) and more for research into sector. Demonstrate an in-depth understanding of financial reporting content, context and legislation. Discusses...
-
The tall vertical pump example was successfully brought down to acceptable vibration levels by placing a long 2- 4-inch beam between the top of the motor and a cinder block wall. What else could...
-
Starn Tool Company has five different intangible assets to be accounted for and reported on the financial statements. The management is concerned about the amortization of the cost of each of these...
-
In light of your personal experience, what strategies or approaches do you believe could be effective in creating a workplace environment where employees from diverse cultural backgrounds feel both...
-
Stellar Sound, Inc., which uses a job-order costing system, had two jobs in process at the start of 20x1: job no. 64 ($84,000) and job no. 65 ($53,400). The following information is available: a. The...
-
How to calculate cost of debt, cost of equity, and D/V? Natural & Organic Whole Foods Market Sprouts Farmers Market The Fresh Market Conventional Grocers Kroger Safeway Supervalu Walmart Target...
-
Network Design for Laboratory Classes on LAN Using OMNET + + + + Network Requirements: Install free version of OMNET + + + + Consider working with at least 5 5 examples on LAN and Wi - Fi networks....
-
In February 28, 2021, BBV Bank had long positions of 200,000,000 Japanese Yen and 50,000,000 wiss Francs. The closing exchange rates were 192/$ and CHF 1.89/$. The bank expects exchange ate to be...
-
File Edit View Go Tools Window Help V 14 Screenshot 2024-... art 14 of 15 ints 0 Q a 1 View previous attempt Check my work Required information [The following information applies to the questions...
-
n electron in a TV camera tube is moving at 7.0010 6 m/s in a magnetic field of strength 67 mT . Without knowing the direction of the field, what can you say about the greatest and least magnitude of...
-
Discuss Margaret Thatchers leadership during the cold war era.
-
If the jobs displayed in Table 18.24 are processed using the earliestdue-date rule, what would be the lateness of job C? TABLE 18.24 Processing Times and Due Dates for Five Jobs Job C D E...
-
Let \(X_{t}, t \geq 0\), be defined as \[X_{t}=\left\{B_{t} \mid B_{t} \geq 0 ight\}, \quad \forall t>0\] that is, the process has the paths of the Brownian motion conditioned by the current value...
-
Let \(B_{t}\) be a standard Brownian motion started at 0 . Use that for any function \(f\) we have: \[\mathbf{E}\left[f\left(B_{t} ight) ight]=\frac{1}{\sqrt{2 \pi t}} \int_{-\infty}^{\infty} f(x)...
-
If \(X_{t} \sim N(0, t)\), calculate the distribution of \(\left|X_{t} ight|\). Calculate \(\mathbf{E}\left|X_{t} ight|\) and \(V\left(\left|X_{t} ight| ight)\).
Study smarter with the SolutionInn App