The following words have three consecutive letters that are also consecutive letters in the alphabet: THIRSTY, NOPE, AFGHANISTAN, STUDENT.         Write a program that accepts a word as input and determines whether or not it has three consecutive letters that are also consecutive letters in the alphabet. I got help from expert for this problem. But I would like to see other solution without using len and ord functions if it possiable.

Question
Asked Nov 24, 2019
75 views

The following words have three consecutive letters that are also consecutive letters in the alphabet: THIRSTY, NOPE, AFGHANISTAN, STUDENT. 

        Write a program that accepts a word as input and determines whether or not it has three consecutive letters that are also consecutive letters in the alphabet. 

I got help from expert for this problem. But I would like to see other solution without using len and ord functions if it possiable. 

check_circle

Expert Answer

Step 1
  • Create a java Class StringSlicer
  • Create methods fillList and displayList in StringSlicer class
  • In main method create object of StringSlicer and call the methods fillList and displayList

 

Step 2

Complete JAVA program:

 

import java.util.Scanner;

import java.util.ArrayList;

 

class StringSlicer

{

            //method to convert string to Character

            public static void fillList(ArrayList<Character> list, String data){

            for(char c : data.toCharArray()){

            list.add(c);

            }

            }

 

            //method to display output characters

            public static void displayList(ArrayList<Character> list){

            for(char c : list){

            System.out.println(c);

            }

 

            }

 

            public static void main(String[] args)

            {

&...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you

Show more Q&A add
question_answer

Q: What is the SQL command to change the BEST_SELLER column in the MYSTERY table to reject nulls (table...

A: Below is the SQL command to create the table MYSTERY.In the given SQL statement NOT NULL constraint ...

question_answer

Q: I need to answer for question no. 2

A: Given that the page size in the system is 4 KB. Using the table and the formulas, the following are ...

question_answer

Q: - Copy the name, salary, and commission of each employee hired before 1980 into TEMP table - Copy th...

A: INSERT INTO query is used to copy the sql data from one table to another table.WHERE is SQL clause u...

question_answer

Q: 3. Write a program that deliberately contains an endless or infinite while loop. The loop should gen...

A: Following is the java program:variables used:z is used to store the result of the multiplication of ...

question_answer

Q: In this unit, we covered several tips for revising and editing documents. What do you believe is you...

A: Revising and editing featuresRevising and editing are the two tasks that are important for the writi...

question_answer

Q: What is encapsulation?Clarify with help of example?

A: Programming language assumed is c++.Data encapsulation:Normally, encapsulation is defined as wrappin...

question_answer

Q: What is the SQL query commands to create the COURSE table (attached) with appropriate attributes and...

A: Course table:COURSE(COURSE_TYPE, DEPARTMENT_ID, COURSE_TITLE, COURSE_DESCRIPTION, COURSE_TYPE_CODE )...

question_answer

Q: Create a new file (in Dev C++) and save it as lab11_XYZ.cpp (replace XYZ with your initials). Create...

A: Program:Filename: lab11_XYZ.cpp// header files #include &lt;iostream&gt; #include "swap_XYZ.h" using...

question_answer

Q: Define the term normalization and functional dependency of 1nf,2nf,3nf as used in normalization

A: Normalization and 1nf,2nf,3nf used in normalizationNormalization is a database design technique that...