Write a program that takes in a line of text as input, and outputs that line...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text. Ex: If the input is: Hello there Hey done the output is: ereht olleH yeH import java.util.Scanner; public class LabProgram { public static void main(String[] args) { while (true) { } String line = scan.nextLine(); if (line.equalsignore Case("Done") Il line.equalsignoreCase("d")) { break; } StringBuilder sb = new StringBuilder (line); System.out.println(sb.reverse().toString()); scan.close(); Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text. Ex: If the input is: Hello there Hey done the output is: ereht olleH yeH import java.util.Scanner; public class LabProgram { public static void main(String[] args) { while (true) { } String line = scan.nextLine(); if (line.equalsignore Case("Done") Il line.equalsignoreCase("d")) { break; } StringBuilder sb = new StringBuilder (line); System.out.println(sb.reverse().toString()); scan.close();
Expert Answer:
Answer rating: 100% (QA)
OUTPUT This program uses a Scanner to read the users input It then checks if the input is Done ... View the full answer
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these programming questions
-
SVB, a financial institution that had become the go-to bank for nearly half of all venture-backed tech startups, failed after a run on its deposits triggered by a series of central bank-endorsed...
-
Can you please explain this ERD Diagram. product_catagory PK id int NOT NULL titile description created at datetime updated at datetime PK d int NOT NULL title char(50) feature_img text content text...
-
Transform the E-R model of project2 into a relational model. TransactionNo Date Hired Education Employee Address NumberOfItems Email 100 MemberD Name Transaction D Member TypeName Member Classify...
-
Implement and maintain internal control procedures This task will require you to roleplay a meeting with your supervisor, Chris Kohler. You will discuss the reporting requirements and timetables...
-
During the early days of the Internet, most dot-coms were driven by revenues rather than profits. A large number were even driven by hits to their site rather than revenues. This all changed in early...
-
Why is ethical decision-making difficult? Discuss.
-
On February 20, 2009, Cedar Valley Aviation, a wholly owned subsidiary of Aerial Services, Inc. (ASI), brought a Piper 522AS (Cheyenne II) in for maintenance to Des Moines Flying Service, Inc....
-
Make versus buy, activity-based costing, opportunity costs. The Weaver Company produces gas grills. This year's expected production is 20,000 units. Currently, Weaver makes the side burners for its...
-
Problem 7. [5 pts] Consider the scalar field f: R R such that f(x) = ||x||7. Compute the gradient of f. Vf(x) = Problem 8. [10 pts] Consider the scalar field : R \ {0} the gradient of f. Vf(x) = R...
-
XYZ is a calendar-year corporation that began business on January 1, 2017. For 2017, it reported the following information in its current year audited income statement. Notes with important tax...
-
Using AHP analysis, select the best vacation home based on the four decision criteria and their associated priorities/weights listed below. Vacation property A is a 3-hour drive from home, has...
-
Describe components of organizational culture. Analyze why organizational culture is important. Classify the culture of your chosen organization as a clan, adhocracy, hierarchy, or market culture...
-
(a) Differentiate between the within and between estimators in panel data analysis. (5) (b) Explain the implications of not considering the correlation structure in panel data and how such a...
-
1. Explain why it is difficult for a health care consumer to have the same knowledge of health care as in another industry such as the automobile industry. 2. Explain how it is possible for a health...
-
Define logistics and explain why logistics management is important. How does logistics management apply to your organization? Logistics incorporates a wide range of business activities: Name four of...
-
Why does health insurance become less expensive when the size of the insurance group increases? Question 25 options: Insurance is less risky to provide, more employees are contributing co-payments,...
-
Evaluate Marxs concept of the capitalist mode of production, as well as his analysis in Capital of the working day and its relation to wage levels and profit rates. Be sure to discuss the concepts of...
-
Find the numerical value of each expression. (a) sech 0 (b) cosh -1 1
-
Draw a physical data flow diagram for process 1.1 inFigure. Customer Not Found Error Valid Custormer Information Vaid Customer Information Order Record 1.6 1.7 Customer Record Order Create 01 Master...
-
Develop a check digit system for the part numbers in Problem 10 using the Luhn formula.
-
Think about how you would organize a data warehouse for Marathon Vitamin Shops. What other databases would you like to merge into the data warehouse? What sort of patterns should Bill Berry be...
-
(a) Determine the critical values for a right-tailed test of a standard population deviation with 15 degrees of freedom at \(\alpha=0.1\) level of significance. (b) Determine the critical values for...
-
A simple random sample of size \(n=20\) is drawn from a population that is normally distributed. The sample variance is found to be 49.3. Determine whether the population variance is less than 95 at...
-
When using \(N=50\) observations to estimate the model \(y_{i}=\beta_{1}+\beta_{2} x_{i}+\beta_{3} z_{i}+e_{i}\), you obtain \(S S E=2132.65\) and \(s_{y}=9.8355\). a. Find \(R^{2}\). b. Find the...
Study smarter with the SolutionInn App