Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Assign 4

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Introduction to Computer Science

Section-A
Assignment-4
Submission: Monday 17th April, 2015 before jumma
Submission path: \\xeon\Spring 2015\Sidra Basharat\ITC\submissions\assign-4
Write a program that reads in a single sentence of characters of maximum length 100 from a file
and outputs the sentence with spacing corrected and with letters corrected for capitalization on
console. In other words, in the output sentence all strings of two or more blanks should be
compressed to a single blank. The sentence should start with an upper case letter but should
contain no other upper case letters. Treat a line break as if it were a blank, in the sense that a line
break and any number of blanks are compressed to a single blank. Assume that the sentence ends
with a period and contains no other periods. For example, the input
the Answer to life, The Universe , and everything
Is 42.
Should produce the following output:
The answer to life, the universe, and everything is 42.
Note:
You can safely assume there are no extra spaces in start and end of sentence.
You have to use c-strings in the above question.
You cannot use any extra array. Using an extra array results in zero marks in assignment.

You might also like