1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kirill115 [55]
3 years ago
14

Write a fragment of code that will read words from the keyboard until the word done is entered. For each word except done, repor

t whether its first character is equal to its last character. For the required loop, use a:_________.
a) while statement.
b) do-while statement.
Computers and Technology
1 answer:
hram777 [196]3 years ago
8 0

Answer:

a)

Scanner keyboard = new Scanner(System.in);

System.out.println("Enter a word");

String word = keyboard.next();

while(!word.equals("done"))

{

if(word.charAt(0) == word.charAt(word.length() - 1))

{

System.out.println("First and last character are equals for the word: " + word);

}

else

{

System.out.println("First and last character are NOT equals for the word: " + word);

}

word = keyboard.next();

}

b)

Scanner keyboard = new Scanner(System.in);

System.out.println("Enter a word");

String word = keyboard.next();

do

{

if(word.charAt(0) == word.charAt(word.length() - 1))

{

System.out.println("First and last character are equals for the word: " + word);

}

else

{

System.out.println("First and last character are NOT equals for the word: " + word);

}

word = keyboard.next();

}while(!word.equals("done"));

Next time note what language you are distributing programming with :)

You might be interested in
Two ways that a deer depends on plants to survive
Nastasia [14]
Food and oxygen would be the answer
4 0
3 years ago
Read 2 more answers
In other programming languages, the dictionary data structure is referred to as a(an)
hjlf

Answer:

hash

Explanation:

it is called a <u>hash,</u><u> </u><u>a </u><u>map</u><u>,</u><u> </u><u>or </u><u>a </u><u>hasmap</u>

5 0
2 years ago
Read 2 more answers
According to a case study in one of our weekly chapter reading, nearly..................... percent of all employees send work e
ozzi

Answer:

A.80, and uncontrolled

3 0
3 years ago
Read 2 more answers
What is the importance of technology in your life?Explain.
Ghella [55]

technology has been very important in my life because, it helps me with my daily struggles, helps with stress (social media), makes everything easier, also creates a more efficient way of learning and much more.

although this should be answered with your own thoughts and opinions, I provided mine if in any case that it helps

8 0
3 years ago
The theory of continental drift is supported by all of the following EXCEPT
Stels [109]
Climate seems like the correct answer
8 0
3 years ago
Other questions:
  • What option would you choose in order to store the database on a dedicated sql server?
    15·1 answer
  • When the minnesota timberwolves encouraged facebook fans to post a great shot of a dunk onto its pinterest page for a chance to
    6·1 answer
  • The approved systems design document is used by programmers, the personnel department, and information systems personnel.
    8·1 answer
  • After running a Google Search Ads campaign for several months, Meredith notices sales of her advertised products are starting to
    8·1 answer
  • Write an application that instantiates five Recording objects and prompts the user for values for the data fields. Then prompt t
    13·1 answer
  • Pleases Help ME An example of a _________________ impact is when a product is back ordered and the business contacts the custome
    5·1 answer
  • What Is entered into the system as input?
    13·1 answer
  • One of 34 possible _________________ can be assigned to each axis of classification in the seven-character code.
    12·1 answer
  • What are the supercomputers and where are they used? ​
    9·1 answer
  • Which statement is true about the energy of electromagnetic radiation?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!