Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN C PLEASE 1 Letter Search and Count We wish to determine how many times a character appears in the file Hamlet.txt. Write C a
IN C PLEASE
1 Letter Search and Count We wish to determine how many times a character appears in the file Hamlet.txt. Write C a program that Prompts the user for a character. Searches through the file Hamlet.txt and prints out how many times the character is found on each line. Your code must count both upper and lowercase instances of the letter separately. If the user enters 'A' then your code must count occurances of 'a' as well as occurances of 'A'. Assuming that the file Hamlet.tact contains To be or not to be, that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles Sample Code Execution 1: Red text indicates information entered by the user Which character would you like to find? T Line 1: 'T' was found 1 times, 't' was found 6 times Line 2: 'T' was found 0 times, 't' was found 4 times Line 3: 'T' was found 1 times, 't' was found 2 times Line 4: 'T' was found 0 times, 't' was found 4 times Sample Code Execution 2: Which character would you like to find? t Line 1: 'T' was found 1 times, 't' was found 6 times Line 2: 'T' was found 0 times, 't' was found 4 times Line 3: 'T' was found 1 times, 't' was found 2 times Line 4: 'T' was found 0 times, 't' was found 4 times Sample Code Execution 3: Which character would you like to find? o Line 1: 'O' was found 0 times, 'o' was found 5 times Line 2: 'O' was found 0 times, 'o' was found 2 times Line 3: 'O' was found 0 times, 'o' was found 5 times Line 4: 'O' was found 1 times, 'o' was found 3 timesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started