
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).
Then create a new Java application called "BackwardsStrings" (without the quotation marks) that:
- Prompts the user at the command line for one 3-character string.
- After the user inputs that first 3-character string, prompts the user for another 3-character string.
- Use IF statement to check that both strings are EXACTLY 3 chars long. IF not, THEN print out "Invalid string length for one or both inputs"
- Use String .charAt(int x) method to manually create a reversed string for each entry
- Print out the two original input strings with a space between them.
- Finally print on a separate line the two input strings 'in reverse' (see example below) with a space between them.
So, for example, if the first string is 'usr' and the second string is 'bin', your program would output something like the following:
The two strings you entered are: usr bin. The two strings in reverse are: nib rsu.
Note that the reversed SECOND string comes FIRST when printing the strings in reverse.
This program must be completed without using loops and without using StringBuilder.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a program that allows the user to enter timein seconds in the text field and press the Enter key to count down the seconds,as shown in Figure d . The remaining seconds are redisplayedevery second.When the seconds are expired, the program starts to play musiccontinuously.arrow_forwardIn Racket, which of the following contains (or is by itself) a call of a selector for the defined movie struct? (Select all that apply)A) (make-movie "Beauty and the Beast" "Gary Trousdale" 92 true)B) (movie-dvd? LION)C) (check-expect (movie-length TOY) 81)D) (movie? 81) (define-struct movie (title director length dvd?)); a Textbook is a (make-book String String Natural Boolean); interp: a movie where; title is the movie’s title; director is the name of the movies’s director; length is the length of the movie in minutes; dvd? is whether the movie is available in dvd format (if true)(define TOY (make-movie “Toy Story" "John Lasseter" 81 true))(define LION (make-movie "The Lion King" "Rob Minkoff" 89 false))arrow_forwarde) Create a new StringBuilder from the String "Prepare for your Midterm Exam". Check the capacity of the StringBuilder and if it's empty. Find the index of the letter 'y'. Delete a substring from the starting index till this index (of 'y'). Insert a string "Good luck on " at the beginning of the StringBuilder. Append '!" to it. Print your StringBuilder to Console.arrow_forward
- // A standard mortgage is paid monthly over 30 years. // This program is intended to display 360 payment coupons // for a new borrower. Each coupon lists the month number, // year number, and a friendly mailing reminder. start num MONTHS = 12 num YEARS = 30 string MSG = "Remember to allow 5 days for mailing" num monthCounter = 0 num yearCounter = 30 while yearCounter <= YEARS while monthCounter <= MONTHS output monthCounter, yearCounter, MSG endwhile endwhile stop housekeeping() print "Enter account number or ", QUIT, " to quit " return printCoupons() while yearCounter <= YEARS while monthCounter <= MONTHS print acctNum, monthCounter, yearCounter, MSG monthCounter = monthCounter + 1 endwhile yearCounter = yearCounter + 1 endwhile output "Enter account number or ", QUIT, " to quit " input acctNum return finish() output "End of job" returnarrow_forwardQuestion 28 Given the following code segment, what is in the string referenced by s1? String s1 = "xy"; String s2 = s1; s1 = s1 s2 + "z"; xyz xyxyz xy xy z xy z Zarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education