Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

specs for FindTwoFirstWords FindTwoFirstWords Write a public class call FindTwoFirstWords with a main method. what it does 1. This class reads any number of Strings

specs for FindTwoFirstWords

 

FindTwoFirstWords

Write a public class call FindTwoFirstWords with a main method.

what it does

1. This class reads any number of Strings from standard input. 2. When a line containing nothing but the String "0" is read, the program displays the two words that would come first in alphabetical order.

Restrictions

do not use arrays, ArrayLists, or anything not covered in class.

Examples

% java FindTwoFirstWords enter a string (end with 0): Z enter a string (end with 0): z enter a string (end with 0): A enter a string (end with 0): Z enter a string (end with 0): C enter a string (end with 0): c enter a string (end with 0): D enter a string (end with 0): d enter a string (end with 0): 0 first: A second: C % java FindTwoFirstWords enter a string (end with 0): A enter a string (end with 0): a enter a string (end with 0): Z enter a string (end with 0): z enter a string (end with 0): C enter a string (end with 0): c enter a string (end with 0): B enter a string (end with 0): b enter a string (end with 0): F enter a string (end with 0): f enter a string (end with 0): 0 first: A second: B % java FindTwoFirstWords enter a string (end with 0): A enter a string (end with 0): ~ enter a string (end with 0): ` enter a string (end with 0): = enter a string (end with 0): + enter a string (end with 0): 1 enter a string (end with 0): 9 enter a string (end with 0): b enter a string (end with 0): a enter a string (end with 0): B enter a string (end with 0): 0 first: + second: 1 % java FindTwoFirstWords enter a string (end with 0): Hello enter a string (end with 0): hello enter a string (end with 0): ?hello? enter a string (end with 0): good bye enter a string (end with 0): Good Bye enter a string (end with 0): bye enter a string (end with 0): BYE enter a string (end with 0): 0 first: ?hello? second: BYE %

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago