Exercises

Do the following problems, name your solutions x1.cc, x2.cc, and x3.cc. Place them in a directory called Mar17.
  1. Write a program prints the lines that have more letters than digits.
  2. Write a program prints the line that has the most lowercase letters among all lines that have no uppercase letters.
  3. Write a program that prints all lines that have the same character appearing twice in-a-row.

There will be no quiz Thursday, March 6th. Meet in the classroom.

The Mar 4th Quiz

Assignment for Tuesday Feb 26th

Place your solutions in a subdirectory named Feb26.

Write a C++ program that prints the numbers from 10 to 25, one per line. Name the program ten.cc. (12 points)

Write a program that reads a text file one character at a time and counts the number of 'a' characters in the file. Name the program acount.cc. Read from cin. (12 points)

Do problem 5 on the sample exam. Name the program rj.cc. (1 point)

Assignment for Thursday Feb 21th

Write a program that reads the dictionary in /u1/junk/cs256/Feb19 and counts how many words begin with a vowel.
So add a line:
#define DICTIONARY "/u1/junk/cs256/Feb19/dictionary"
Note: The vowels are 'a', 'e', 'i', 'o', and 'u'. Name your program findvowels.cc and save it in a directory named Feb21. For a really good grade, count the words that begin and end with a vowel. Name the program findboth.cc.

Assignment for Tuesday Feb 19th

Write a program that reads a file named as a command line argument and prints all the lines that have a least one upper case letter on them. Name your program uppercase.cc and save it in a directory named Feb19. Note: the period at the end of the last sentence is not part of the name!

Assignment for Thursday Feb 14th

Write a program that reads a text file from standard input and prints all the lines that end with a lower case letter. Name your program valentine.cc and place it in a subdirectory of your home directory named Feb14. Note: the period at the end of the last sentence is not part of the name!

The Feb 7th Quiz

Links