Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Lab 06 – While and For

Exercise 1.

Re-write the exercises from lab 01 – Exercise 2 using loops, you are only allowed to use one printf statement.  (Labs are available on blackboard).  Part b will require a bit of thought so if you get stuck on it, leave it and come back to it later.

Exercise 2.

Write a program that asks the user for a number (integer) and then will read in from the user the same number of floating point values.  When the user has entered the correct number of values, output the sum of those values.

Exercise 3.

Ask a user to type in a short message for inclusion in a twitter message (280 Characters or less).  Once the users has typed in the message the program should :

a) Repeat the message.

b) Display statistics showing :

· Total number of non-white space characters in the message.

· Total number of numbers in the message.

· Total number of lower case letters in the message.

· Total Number of upper case letters in the message.

· Total Number of non-alphanumeric or white space characters in the message.

· The most common character in the message.