Computer Science I

MC140.01
Spring 2001
Assignment 4
due Monday 19 February 2001

 


The goal of this assignment is to practise using strings.

This assignment is worth 2% of your semester grade -- i.e., it will be marked out of 20 points.

Read through the ENTIRE assignment before you begin.

For this assignment, you will write a program that writes your name, horizontally and vertically.

First, the program should ask (or "prompt") the user to enter his/her name.
The program should store the name in a string variable.
Then the program should print out the name vertically, in square 4X4 blocks, each containing one letter of the user's name.
Then the program should print out the name horizontally, in square 4X4 blocks, each containing one letter of the user's name.
The program should print a blank line between the entry line and the vertical name, and between the vertical name and the horizontal name. The program should print a blank character between each letter in the horizontal name.

Here's a sample run. The letters in big, bold font were entered by the user. The rest was output by the computer.



please enter your name: alex

aaaa
aaaa
aaaa
aaaa
llll
llll
llll
llll
eeee
eeee
eeee
eeee
xxxx
xxxx
xxxx
xxxx

aaaa llll eeee xxxx
aaaa llll eeee xxxx
aaaa llll eeee xxxx
aaaa llll eeee xxxx


1. Write the program, as specified above:

Name your program <your-user-name>-ass4.c (e.g., sklarel-ass4.c), in lower-case letters (1 point).

2. Make sure you do the following:

3. Submit the assignment in the usual way (i.e., follow the submission instructions from assignment #1). Make sure that the name of the file you submit is entirely in lower-case letters and you use the proper naming format, as described in step 1, above. Note that this time, you will lose one point if you do not name your file properly!!!

4. Also, please bring a hardcopy to class!