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: 50% (2 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?
-
A discount outlet offers a 20% discount on all items. Write a linear equation giving the sale price S for an item with a list price L.
-
How does make determine whether a target needs to be rebuilt?
-
Fiber Systems manufactures an optical switch that it uses in its final product. The switch has the following manufacturing costs per unit: Another company has offered to sell Fiber Systems the switch...
-
8. A straight section of railroad track crosses two highways 400 m and 600 m from an intersection. Find the dimensions of the largest rectangular lot that can be laid out in the triangle formed by...
-
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
-
Inuit Industries provides you with the following partially completed process-costing report. The cost of goods completed and transferred out (COGM) contains $162,000 of materials costs and $108,000...
-
A retailer of organic, green, and cruelty-free cosmetics has seen huge global expansion over the last 5 years. They have 350 stores in 15 countries across 5 world regions. What would be the most...
-
In late 2009, Federal Reserve Chairman Ben Bernanke wrote the following in a column published in the Washington Post: [Proposals in Congress to reduce the independence of the Fed] are very much out...
-
You are the CEO of a multinational corporation that has grown organically over the past 30 years. You know that your organizational structure is long overdue for a major change. The coordination of...
-
By 2012, actions by the Federal Reserve and other central banks had driven shortterm interest rates close to zero. One portfolio manager was quoted as saying: The market has heard central bankers...
-
Trees Forever, a community foundation, incurred $5,000 in expenses during 20X3 putting on its annual fund-raising talent show. In its statement of activities, Trees Forever should report the $5,000...
-
Trudy comes to Pat, her supervisor, and tells her that Jack has been sexually harassing her by making suggestive remarks, comments, and jokes; constantly asking her for dates; and using every...
-
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.
-
On March 13, 2020, you convert 500,000 U.S. dollars to Japanese yen in the spot foreign exchange market and purchase a six-month forward contract to convert yen into dollars. How much will you...
-
When applying for Medicaid all of the following constitute a "countable asset" EXCEPT: Spouse's section 401(k) plan Equity in home owned jointly with spouse Worker's own section 401(k) plan Jointly...
-
You have just graduated from university and are considering starting a new line clothing. To start the new line of clothing you require a capital outlay of $25,000 and net working capital of $1,000....
Study smarter with the SolutionInn App