Question: Write a C program that prompts the user to enter the number of the line that he/she would like to read, then, the program read

Write a C program that prompts the user to enter the number of the line that he/she would like to read, then, the program read the selected line from a text file named infile.txt. The infile.txt contains a list of persons first names. After that, the program displays the read name using starts (*) (Hint: declare an empty string and then fill it with starts based on the number of the letters in the read name and print it).
Finally, the program prompts the user to enter a letter (for example a) and if the letter exists in the read name, the program displays the message The selected first name has the letter a. Otherwise, the program displays the message The selected first name does not have the letter a
 Write a C program that prompts the user to enter the
number of the line that he/she would like to read, then, the

Sample for infile.txt: F1 infile.txt -/Desktop/MyFiles Save Open 1 sally 2 lina 3 mays 4 murad 5 kamal 6 sameer Sample Output: hiba@hiba-VirtualBox:-/Desktop/MyFiles Q= htba@hlba-Virtualbox:-/Desktop/Myrtless ./out Please enter the number of the line that you would like to read> 2 The selected first name displayed using stars: **** Please enter a lettern The selected first name does not have the letter m hiba@hiba-VirtualBox:-/Desktop/MyFiless ./out Please enter the number of the line that you would like to read> 2 The selected first name displayed using stars: **** Please enter a letters a The selected first name has the letter a htbaahtba-virtualBox:-/Desktop/MyFiless I hiba@hiba-VirtualBox: -/Desktop/MyFiles a = htbachtba-VirtualBox:-/Desktop/Myrtles$ ./out Please enter the number of the line that you would like to read> 6 The selected first name displayed using stars: ****** Please enter a letters The selected first name has the letter s htba@htba-VirtualBox:-/Desktop/MyFiles$

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!