Question: Problem 1 (35 points): Jumbled File Fix Your boss has given you a file, named Scrambled File.txt, that is completely jumbled. The file is actually

 Problem 1 (35 points): Jumbled File Fix Your boss has given

Problem 1 (35 points): Jumbled File Fix Your boss has given you a file, named Scrambled File.txt, that is completely jumbled. The file is actually a mixture of two separate files, one of which is supposed to be strictly numerical [ie. contains only digits 0-9), and the other contains only non-numerical characters Write a C program that reads the file Scrambled File.txt, one character at a time. If the character is non-numerical then print this character to a file called Unscrambled.txt. If the character is a numeric digit then your boss would like to know the largest product of 4 consecutive digits in the data. For example if the file Scrambled File.txt, contains 15H8e29211387400234 482T009312423m234 then the file Unscrambled.txt, would contain the message Hello Tim and the following message would be printed to the screen The largest product of a 4-digit sequence is 5 * 8* 2*9- 720 Note that the character '0' has an ASCII value of 48, and the character '9' has an ASCII value of 57. Write a function isdig as follows int isdig(char c, int *Current_Digit) I/This function returns 0 if the character c is non-numerical, or //returns 1 if the character c is a digit (ASCIl value 48 to 57) // If a 1 is returned the *Current_Digit contains the integer number // lf, for example, c = 7' then *Current Digit 7, and a 1 is returned // If, for example, c = '+' then a 0 is returned Use the function Update Samples to help keep track of old values void Update_Samples(int Current_Digit, int *One_Frames_Old, int Two_Frames Old, int Three_Frames Old) ( *Three Frames Old- *Two Frames Old Two_Frames Old- *One_Frames Old *One-Frames-old = Current-Digit; return; For this problem, if your program is working, the Unscrambled.txt file will contain the pattern that you can read and the largest product of 4-digit sequence (from Scrambled File.txt) is 5832

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!