Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students explore these related Databases questions

Question

Prove that (3 n ) n is not O ( n n +1 )

Answered: 3 weeks ago