The George Washington University
School of Engineering and Applied Science
Department of Computer Science
CSci 51 -- Introduction to Software Development -- Spring 2001
Lab #7
For labs meeting on Mar. 1-2, 2001

The purpose of this exercise is to give you some practice writing a file.

Write a program that writes a series of names and phone numbers to a file.

The program will

  1. ask how many names/numbers are coming in
  2. for each name/number set, ask for the user's first name (a string of exactly 10 characters--enter trailing blanks if necessary) and the user's last name (another string of exactly 10 characters). Then ask for the area code (Positive), then the first three numbers (again Positive), then the last four numbers (again Positive). All this information is then written to a file. The output should look like this (for two numbers):
2
Alice
Armstrong
(123) 456-7890
Michael
Feldman
(212) 555-1212