The following program should be done in C++
Write a function (module) that reads the contents of a file named Char.txt (you will have to create this file on notepad or any other text editor and write a sentence of your choice. Your sentence should include upper case, lower case, and numbers.
Keep in mind you need to submit this file as well) and determine the following:
- The number of uppercase letters in the file . The number of lowercase letters in the file
- The number of digits in the file
- The total number of characters in your sentence.
Upon finishing the task, program will ask the user if they would like to read the same file again and the program will re-start (you need to utilize a loop to do so) should the user prompt the program with 'Y'.
Prompts and Output Labels. There are no prompts-- nothing is read from standard keyboard, just from the file Character.txt.
Each of the numbers calculated is displayed on a separate line on standard output, preceded by the following prompts (respectively): "Uppercase characters:".
"Lowercase characters : ", "Digits: "
Input Validation. If the file was not found your program should output a message saying "Can't Locate the File" and then asks the user to re-input the file name.
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- create a program in C++ that does the extraction and analysis described above except that the tasks shall be made somewhat simpler. The program shall read from a file "inputdata.txt" containing a name and exactly five values of floating point numbers per line in the file. The first line of the file shall contain the name of the person (first and last) that gathered the data i.e. Joe Jones. The second line of the file shall be the first row of data. Your program will process all the lines in the file as described below. As the program reads each row of data, it shall do two things: it shall keep a running sum of the values read for that row, and shall also write the average of that row to a file "averages.txt". The program will continue reading from the file until it reaches the end of the file. This will entail using a "while" loop and the eof() function that is talked about in Chapter 13 of the text book. The person's name is to be read in at one time using "getline" and stored under…arrow_forwardpython Now write another program that reads the text file created in the program above and calculates the user's weekly pay. The program should begin by prompting the user for the regular hourly pay rate. The program should then loop through the file and report the days and hours worked. The program should finish by calling a custom void function named calc_pay that calculates and prints the weekly pay, including overtime, if applicable. By law, weekly hours in excess of 40 should be paid at 1.5 times the regular hourly rate. The calc_pay function takes two arguments, total hours and hourly pay rate, and it must be imported from a separate module file. Note that three outputs are required for the pay.Sample Output 1Enter your hourly pay rate 25.00Here are your hours this weekMonday hours : 10.0Tuesday hours : 8.0Wednesday hours : 12.0Friday hours : 12.0Saturday hours : 8.0You worked 50.0 hours this weekYou worked 10.0 hours overtimeYour hourly pay rate is $25.00 Regular pay :…arrow_forwardI need help making C++ code. I need help writing a program that asks the user for the name of a text file. The program should display the first 10 lines of the file on the screen. If the file has less than 10 lines, the entire file should be displayed along with a message indicating the entire file has been displayed.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education