Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: Write a program that analyzes a collection of words and sorts them in ascending order by the number of vowels, consonants, and the length

Objective:

Write a program that analyzes a collection of words and sorts them in ascending order by the number of vowels, consonants, and the length of the word.

First download the driver file and the text file and include it in your project

Next write a class called WordHelper and implement the following methods

  • sortByVowels: This static method returns a sorted String array, takes in an array of Strings via a parameter, and sorts them from smallest to largest by the number of vowels.
  • sortByConsonants: This static method returns a sorted String array, takes in an array of Strings via a parameter, and sorts them from smallest to largest by the number of consonants.
  • sortByLength: This method static returns a sorted String array, takes in an array of Strings via a parameter, and sorts them from smallest to largest by the number of letters.

You may

  • Write additional methods and classes to best complete this project
  • Assume that only alphabetic characters are in the words
  • Assume that Y counts as a vowel
  • Write any kind of sorting algorithm
  • Assume that in the event of ties that any arbitrary word is picked.

You may NOT

  • Use any built in sorting methods (such as Arrays.sort())
  • Assume that it is case sensitive, so A and a are considered the same character.

Example Dialog:

The original word list

century

army

spit

twin

frog

guideline

impulse

distributor

hallway

appeal

fitness

pudding

mild

enter

kitchen

constitutional

die

condition

morsel

jealous

colorful

myth

belly

rugby

valid

shot

locate

preference

representative

chart

prince

think

threshold

health

sweater

volume

poison

lease

toast

diplomat

trait

cower

slime

handy

example

sanctuary

board

crash

large

attract

censorship

room

license

smoke

roll

taste

inflate

continuation

establish

fault

gown

dirty

width

qualify

reference

excitement

vegetable

wear

confusion

concept

willpower

snarl

develop

integration

pie

respectable

fast

limit

shaft

acceptance

insert

brown

death

effective

ticket

play

highway

lot

tablet

mother

pier

facility

match

animal

sport

laundry

negligence

white

vat

nuclear

The word list sorted by Vowels

spit

twin

frog

mild

myth

shot

chart

think

crash

roll

gown

width

snarl

fast

shaft

brown

lot

match

sport

vat

army

fitness

pudding

enter

kitchen

die

morsel

belly

rugby

valid

prince

threshold

health

toast

trait

cower

slime

handy

board

large

attract

room

smoke

taste

fault

dirty

wear

concept

pie

limit

insert

death

ticket

play

tablet

mother

pier

white

century

impulse

hallway

appeal

colorful

locate

sweater

volume

poison

lease

diplomat

example

censorship

license

inflate

establish

willpower

develop

highway

animal

laundry

nuclear

distributor

condition

jealous

preference

sanctuary

qualify

reference

excitement

vegetable

confusion

respectable

acceptance

effective

facility

negligence

guideline

integration

constitutional

representative

continuation

The word list sorted by Consonants

die

pie

army

lease

room

wear

play

lot

pier

vat

spit

twin

frog

appeal

mild

enter

jealous

myth

belly

rugby

valid

shot

locate

volume

poison

toast

trait

cower

slime

handy

board

large

smoke

roll

taste

fault

gown

dirty

qualify

fast

limit

death

animal

white

century

guideline

impulse

hallway

morsel

chart

prince

think

health

sweater

example

crash

license

inflate

width

snarl

develop

shaft

insert

brown

ticket

highway

tablet

mother

facility

match

sport

laundry

nuclear

fitness

pudding

kitchen

condition

colorful

diplomat

sanctuary

attract

reference

vegetable

confusion

concept

effective

preference

continuation

establish

excitement

willpower

integration

acceptance

negligence

distributor

threshold

censorship

respectable

constitutional

representative

The word list sorted by Length

die

pie

lot

vat

army

spit

twin

frog

mild

myth

shot

room

roll

gown

wear

fast

play

pier

enter

belly

rugby

valid

chart

think

lease

toast

trait

cower

slime

handy

board

crash

large

smoke

taste

fault

dirty

width

snarl

limit

shaft

brown

death

match

sport

white

appeal

morsel

locate

prince

health

volume

poison

insert

ticket

tablet

mother

animal

century

impulse

hallway

fitness

pudding

kitchen

jealous

sweater

example

attract

license

inflate

qualify

concept

develop

highway

laundry

nuclear

colorful

diplomat

facility

guideline

condition

threshold

sanctuary

establish

reference

vegetable

confusion

willpower

effective

preference

censorship

excitement

acceptance

negligence

distributor

integration

respectable

continuation

constitutional

representative

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 Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions