Lab 01

Sorting Various Words by Various Properties

 

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.

 

Lab Solution

 

Requirements:

 

 

Additional Notes:

 

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

 

Solution Tests:

  1. Is your name written as a comment in all source files?
  2. Does the solution compile (no syntax errors)?
  3. When running the driver, do you get the same output as the Example Dialog?

 

Lab Report

 

  1. Create a section named “Problem” and describe this lab’s problem in your own words. (10pts).
  2. Create a section named “Solution Description” and describe how the code solves the problem in your own words. (10pts).
  3. Create a section named “Problems Encountered” and describe the various syntax, run-time, and logic errors that were encountered while implementing the solution. (10pts).
  4. What are the advantages of using an array? (10pts)
  5. What are the disadvantages of using an array? (10pts)
  6. Describe the range of valid indices for an array. (10pts)
  7. Looking at the below code snippet, is this code error free and if so, what will it print to the console? If the code does have errors, then describe all syntax, run-time, and logic errors and how they may be fixed. (10pts)

 

  1. Looking at the below code snippet, its purpose is to count all the values found in the Array “array” that are divisible by 4, divisible by 5 or both. Is this code error free and if so, what will it print to the console? If the code does have errors, then describe all syntax, run-time, and logic errors and how they may be fixed. (10pts)

 

  1. Looking at the below code snippet, the purpose of this static method is to make a copy of an integer array and return the copy, but it does not seem to work correctly. Describe all syntax, run-time, and logic errors and how they may be fixed. (10pts)

  1. Looking at the below code snippet, is this code error free and if so, what will it print to the console? If the code does have errors, then describe all syntax, run-time, and logic errors and how they may be fixed. (10pts)

 

Finally

Upload the Lab Solution’s source code (.JAVA file(s)) and the Lab Report’s text file to the CSCE Dropbox.