Hello, I need help programming this in C using the program CodeBlocks In this lab you will create a line counter program similar to the
Hello, I need help programming this in C using the program CodeBlocks
In this lab you will create a line counter program similar to the book version. You may also use the version shown in class as a starting point. This lab does not provide a baseline code, you must start the program from scratch. Your version will have two extra features beyond the ones from class and the book:
The main while loop (used to end the program) must detect the condition of double newline. When the user enters two newlines back-to-back, exit the program
The program will count space characters. Only space characters are counted, not other forms of whitespace such as tabs. The method of counting is special, it will count consecutive spaces as one "space block" and each space block gets one count on the counter. For example, a string of three spaces in a row is counted as one space because they are back-to-back in the input sequence.
The expected output should look like the following (exact output depends on user input):
11111 22222 33333 linecount=1 spacecount=2 yyyyyyyyyyyyyyyyy linecount=2 spacecount=2 y y y y y y linecount=3 spacecount=7 112 112 112 112 linecount=4 spacecount=10 3333333333333333333333333 33333333 linecount=5 spacecount=11 333333 333333 3333333 linecount=6 spacecount=13 abcdefg linecount=7 spacecount=13 yyyyyyyyyy yyyyyyyyyy yyyyyyyyy linecount=8 spacecount=15 linecount=9 spacecount=15 FINAL linecount=9 spacecount=15
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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