Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reads a character, then reads in a list of words. The output of the program is every word in the list

Write a program that reads a character, then reads in a list of words. The
output of the program is every word in the list that contains the character at
least once. Assume at least one word in the list will contain the given character.
1 The Challenge
create a set called 'charSet'
charSet contains a..z and A..Z
prompt for a char
validate the char entered against charSet
validate the char entered length
prompt for a list of words
print a list of words delimited with a ',' that have the char in them
2 Input
prompt for a char
prompt for a list of words
3 Output
a list of words with the char in them
an error message, if the char is snot valid
4 Example
Enter a character: Z
Enter a list of words: Zoo zookeeper Zonk Mazzu
Zoo,Zonk,
Enter a character: Toolong
Invalid Character!
Enter a character: *
Invalid Character!
image text in transcribed

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 And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions

Question

Find dy/dx if x = te, y = 2t2 +1

Answered: 1 week ago