Modify the program in Fig. 3.10 to validate its inputs. For any input, if the value entered
Question:
Modify the program in Fig. 3.10 to validate its inputs. For any input, if the value entered is other than 1 or 2, keep looping until the user enters a correct value.
Fig. 3.10
Transcribed Image Text:
Enter result (1= Enter result (1 = Enter result (1 Enter result (1 Enter result (1 Enter result (1 Enter result (1 Enter result (1 Enter result (1 Enter result (1 Passed: 6 Failed: 4 = = = = = = = = = pass, 2 pass, 2 fail): 1 pass, 2 = fail): 2 fail): 1 fail): 2 fail): 1 fail): 2 fail): 2 fail): 1 fail): 1 fail): 1 pass, 2 pass, 2 pass, 2 pass, 2 pass, 2 pass, 2 pass, 2 pass, 2 = = = = = = = =
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 33% (3 reviews)
It looks like the figure you provided is a screenshot of a console application that takes user input ...View the full answer
Answered By
Branice Buyengo Ajevi
I have been teaching for the last 5 years which has strengthened my interaction with students of different level.
4.30+
1+ Reviews
10+ Question Solved
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Question Posted:
Students also viewed these Computer science questions
-
Write code using struct-defined data types Organize source code in multiple header and implementation files (.h and .cpp files). Create, initialize, read, update, and display the contents of struct...
-
You will design and implement your own data class. The class will store data that has been read as user input from the keyboard (see Getting Input below), and provide necessary operations. As the...
-
Write a C++ program to calculate Basal Metabolic Rate and total calorie needs. Use the Harris Benedict equation to calculate calorie needs. 2. The program must use at least three functions or...
-
A production supervisor at a major chemical company wishes to determine whether a new catalyst, catalyst XA-100, increases the mean hourly yield of a chemical process beyond the current mean hourly...
-
Where can authoritative iGAAP related to the accounting for taxes be found?
-
The rate of heat flow per unit length q/L through a hollow cylinder of inside radius ri and outside radius ro isq/L = ( A k ??T)/(ro ?? ri)where A = 2 (ro ?? ri)/ln(ro/ri). Determine the percent...
-
What are the advantages and disadvantages of surface condensers ?
-
A furniture factory makes two types of wooden tables, large and small. Small tables are made in batches of 100, and large tables are made in batches of 50. A batch includes a fixed setup time for the...
-
Timter Company uses a normal job-order costing system. The company has two departments through which most jobs pass. Selected budgeted and actual data for the past year follow: Budgeted overhead...
-
The Java compiler always associates an else with the immediately preceding if unless told to do otherwise by the placement of braces ({ and }). This behavior can lead to what is referred to as the...
-
Write a Java application that uses looping to print the following table of values: N 12445 3 N 1 4 9 16 25 N 1 8 27 64 125 N4 1 16 81 256 625
-
On a T-s diagram of Fanno flow, what do the points on the Fanno line represent?
-
Prove that \(b(x ; n, p)=b(n-x ; n, 1-p)\).
-
Given that \(f(x)=\frac{k}{2^{x}}\) is a probability distribution for a random variable that can take on the values \(x=\) \(0,1,2,3\), and 4 , find \(k\).
-
Determine whether the following can be probability distributions of a random variable which can take on only the values \(1,2,3\), and 4 . (a) \(f(1)=0.19, \quad f(2)=0.27, \quad f(3)=0.27\), and...
-
A food processor claims that at most \(10 \%\) of her jars of instant coffee contain less coffee than claimed on the label. To test this claim, 16 jars of her instant coffee are randomly selected and...
-
How much heat energy is needed to convert a mixture of \(20.0 \mathrm{~g}\) of ice and \(35.0 \mathrm{~g}\) of water at thermal equilibrium to steam at \(100.0^{\circ} \mathrm{C}\) ? If this energy...
-
Opening a multimillion dollar musical on Broadway is the ultimate financial gamble. Hits such as The Phantom of the Opera can earn millions in profit. Disasters too numerous to name have meant...
-
Using the parallel-axis theorem, determine the product of inertia of the area shown with respect to the centroidal x and y axes. 6 in. 9 in. 9 in- 4.5 in. in. 4.5 in.
-
Redo the justification of Proposition 7.2 assuming that the the cost of growing the array from size k to size 2k is 3k cyber-dollars. How much should each push operation be charged to make the...
-
The java.util.ArrayList includes a method, trimToSize( ), that replaces the underlying array with one whose capacity precisely equals the number of elements currently in the list. Implement such a...
-
Give a justification of the running times shown in Table 7.1 for the methods of an array list implemented with a (nonexpanding) array.
-
In January 2023, Marty's Fine Pens, a business carried on as a sole proprietorship, sells a limited-edition fountain pen for $125,000. The cost of the pen is $63,000. There is a down payment of...
-
An 90000 loan is amortized by payments of $1850 at the end of every 6 months at a rate of 2% compounded monthly 1. Construct a partial amortization schedule showing the last 2 payments 2. determine...
-
Kelso's has a return on equity of 15.2 percent, a debt-equity ratio of 44 percent, a capital intensity ratio of 1.08, a current ratio of 1.25, and current assets of $138,000. What is the profit...
Study smarter with the SolutionInn App