Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
Write a program that displays the following menu:
Menu
1. Count a letter
2. Eliminate a letter
3. Replace a letter
4. Exit
Enter an option:
The program prompts the user to enter a menu option (1, 2, 3 or 4).
Note: After processing any option, the menu is displayed again. The program runs continuously until the user selects option 4.
Option 1: The program prompts the user for a word and a letter; then displays the number of times that the letter is found in the word.
For example, if the word is banana and the letter is a, the output should be:
Letter a appears in word banana 3 times.
Option 2: The program prompts the user for a word and a letter; then displays the word without the letter.
For example, if the word is banana and the letter is n, the output should be: baaa
If the word is banana and the letter is x (there’s no x in banana), the output should be: banana
Option 3: The program asks for a word, a letter to be replaced, and the replacement letter. If the letter to be replaced exists in the word, all occurrences of it are replaced by the replacement letter.
For example if the word is banana, the letter to be replaced is a, and replacement letter is o, then the output should be: bonono
If the word is banana, the letter to replace is z, replacement letter is y, the output should be: banana
When your program is working, make it check that the user entered an integer instead of a real number or text . Then check that the integer entered is between 1 and 4. If the user types in an invalid entry, display an error message, and ask the user again.
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team