Question
C Language problem need help with Problem 12 from Problem Solving and Program Design in C textbook, chapter 6: Since communications channels are often noisy,
C Language problem need help with
Problem 12 from Problem Solving and Program Design in C textbook, chapter 6: Since communications channels are often noisy, numerous ways have been devised to ensure reliable data transmission. One successful method uses a checksum. A checksum for a message can be computed by summing the integer codes of the characters in the message and finding the remainder of this sum divided by 64. The integer code for a space character is added to this result to obtain the checksum. Since this value is within the range of the displayable characters, it is displayed as a character as well. Write a program that accepts single-line messages ending with a period and displays the checksum character for each message. Your program should continue displaying check-sums until the user enters a line with only a period.
ADDITIONAL INFO for assignment: Output the lines of text to a file as they are entered, as well as the checksum calculated per the instructions in the problem.
Print the double quote at the beginning of each line, and the double quote after the period that ends each line. Following that, print the text Checksum= and a single quote followed by the checksum character you computed, followed by another single quote. This will end up on the following line, because you have to enter a on the keyboard to tell the computer to process the line you just entered.
Have main call a function named DoAssignment6_12 which does the assignment logic. Have it return to main the number of lines that were entered to both the console and the file.
Consider writing other functions, with names such as ProcessSingleLine .
Be sure to close the file when you are finished with it.
Test a minimum of 5 cases including the following 3:
does this work?. // dont enter the quotation marks just the text
\twow amazing. // dont enter the quotation marks or the backslash and the t, enter tab etc.
. // dont enter the quotation marks just the period
Test with a minimum of the cases presented, more is better.
Here is the output file
"does this work?." Checksum='E'
" wow amazing." Checksum='M'
".
Step 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