Convert the do-while loop in the following code to a while loop: Scanner keyboard = new Scanner(System.in);
Question:
Convert the do-while loop in the following code to a while loop:
Scanner keyboard = new Scanner(System.in);
String input;
char sure;
do
{
System.out.print("Are you sure you want to quit? ");
input = keyboard.next();
sure = input.charAt(0);
} while (sure != 'Y' && sure != 'N');
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 90% (10 reviews)
import javautilScanner class main public static ...View the full answer
Answered By
Marvine Ekina
Marvine Ekina
Dedicated and experienced Academic Tutor with a proven track record for helping students to improve their academic performance. Adept at evaluating students and creating learning plans based on their strengths and weaknesses. Bringing forth a devotion to education and helping others to achieve their academic and life goals.
PERSONAL INFORMATION
Address: , ,
Nationality:
Driving License:
Hobbies: reading
SKILLS
????? Problem Solving Skills
????? Predictive Modeling
????? Customer Service Skills
????? Creative Problem Solving Skills
????? Strong Analytical Skills
????? Project Management Skills
????? Multitasking Skills
????? Leadership Skills
????? Curriculum Development
????? Excellent Communication Skills
????? SAT Prep
????? Knowledge of Educational Philosophies
????? Informal and Formal Assessments
0.00
0 Reviews
10+ Question Solved
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Question Posted:
Students also viewed these Computer science questions
-
Consider the following sequence of defective parts (d) and nondefective parts (n) produced by a machine. Can we reject the hypothesis of randomness at a = 0.05 ? nnndnnnnnd n n n nnd n d n n n
-
For the collar of Problem 2.35, determine (a) The required value of if the resultant of the three forces shown is to be vertical, (b) The corresponding magnitude of the resultant. 30 100 N 200 N 150...
-
Assignment 5: Hash Table implementation andconcordance There are three parts to this assignment. In the first two parts,you will complete the implementation of a hash map and aconcordance program. In...
-
Conduct an internal and external analysis of yourself in the current business industry. examples: you are an accounting major so your environment is the cpa job market. you are a finance major so...
-
Upon starting your new job after college, you've been confronted with selecting the investments for your 401(k) retirement plan. You have four choices for investing your money: A money market fund...
-
Carlos "Coyote" Jones owns quite a few harmonicas. In particular, he has 7 professional harmonicas and 12 cheaper harmonicas. They have relatively similar shapes, so when he reaches into his...
-
Researchers from the National Institutes of Health want to determine the current rates of smoking among adult males and adult females. They conduct a survey of 500 adults of each gender. Indicate...
-
Tim Snyder and Jay Wise have decided to form a partnership. They have agreed that Snyder is to invest $30,000 and that Wise is to invest $40,000. Snyder is to devote full time to the business, and...
-
need information on the following: interpersonal skills cash handling office practices and procedures understanding and following directions mathematics verifying accuracy of information
-
Zeff Company purchases a delivery van on January 1, Year 1, at a cost of $15,849. It has a useful life of four years and no estimated salvage value . When making the purchase decision, the company...
-
The do-while loop is this type of loop. a. Pretest b. Posttest c. Prefix d. Postfix
-
Which loop should you use when you know the number of required iterations?
-
Let (x) = x 2 + 4, g(x) = 2x + 3, and h(x) = x - 5. Find each of the following. (7-) (108)
-
1. (20 points) Let A[1..n] be an array that stores n possibly non-distinct numbers. (a) (10 points) A range query specifies two integers and y that form an interval (x, y]. The answer to a range...
-
Exercise 3 (section 30): 1) Consider the task of fully justifying a paragraph of text to a target length, by putting as many words as possible on each line and evenly distributing extra spaces so...
-
Write a function that sorts the content of a generic stack according to user input. If the user enters 0, the stack is sorted in ascending order (element at top is the smallest and element at bottom...
-
The PARTITION problem is: Given a set S of n integers, can it be split into two subsets with equal sums? That is, are there subsets A and B such that AUB= S, AnB = 0, and a Aa= bEB b? For example,...
-
4. [Decision Trees] (6 pts) In class, we covered how to learn binary decision trees. In this question, you will modify the decision tree learning algorithm to obtain ternary decision trees (i.e, each...
-
In what way did Rutherford's gold-foil scattering experiment show that the atomic nucleus is both small and very massive?
-
Chris Zulliger was a chef at the Plaza Restaurant in the Snowbird Ski Resort in Utah. The restaurant is located at the base of a mountain. As a chef for the Plaza, Zulliger was instructed by his...
-
Design a program that lets the user enter the total rainfall for each of 12 months into a list. The program should calculate and display the total rainfall for the year, the average monthly rainfall,...
-
Assume scores is a list of randomly-ordered numbers between 0 and 100. Write code that sorts the list, reverses the order of the items in the list, and prints the biggest value in the list.
-
What will the following code display? values = [2, 4, 6, 8, 10] print(values[1:3])
-
Risk tracking and reporting Explain how risks will be tracked and outline the reporting requirements. ? Specify any tools that will be used in the risk management process, e.g. Risk Log, and indicate...
-
Define the following terms and explain their importance to the study of economics. a. partnership b. corporation c. limited liability d. plowback
-
How do you ask for help with your partner for money in paying rent? Explain
Study smarter with the SolutionInn App