CS303E Homework 1

Instructor: Dr. Bill Young
Due Date: Wednesday, January 24, 2024 at 11:59pm

Starting Programming in Python

Your task is to write a program that prints your initials in large letters. For example, my initials are W.D.Y. So I might print these out as shown below. If your name has less than 3 initials, pad on the right with X's. For example, if your initials are A.B., you should display A.B.X. If you have more than 3 initials, you can give them all or stop at 3; that's your choice.

  WW        WW      DDDDDDDD          YY        YY      
  WW        WW      DDDDDDDDDD         YY      YY       
  WW        WW      DD       DD         YY    YY        
  WW        WW      DD        DD         YY  YY         
  WW        WW      DD        DD          YYYY          
  WW   WW   WW      DD        DD           YY           
  WW  WWWW  WW      DD        DD           YY           
  WW WW  WW WW      DD       DD            YY           
  WWWW    WWWW  ..  DDDDDDDDDD    ..       YY       ..  
   WW      WW   ..  DDDDDDDD      ..       YY       ..  

Note that the big "W" is made of uppercase "W"s, the big "D" is made of uppercase "D"s, and so on. Each letter should be exactly 12 characters wide and 10 lines high, with one exception: if one of your initials is "I" make it 6 characters wide, rather than 12, with a serif at the top and bottom. (A serif is that wider area at the top and bottom.) Each line segment making up each letter generally should be 2 characters thick. (Do your best for curved letters, but don't stress it!) Each letter should be followed by a period, drawn using four "." characters, as shown above. There should be two empty columns of spaces to the left and to the right of each letter and period (including the final period). Notice that this means that every line should be exactly the same length, so pad on the right with blanks as needed. You won't see them on the screen, but it would be helpful if, for example, you or someone else needed to modify your program by adding another letter on the right.

Also, there should be an empty line at the top and one at the bottom. (You can create an empty line with the command print(). It doesn't have to contain any spaces.)

BTW, your output won't look right unless you are using a fixed width font (all letters are the same width). Most editors allow you to choose a font. If your output looks OK, you have a fixed width font; there's no way it will look right with a variable width font.

Note 1: This assignment is only about printing some text; you don't have to generate each letter with a program or anything complicated like that. You can just create them in a buffer or file using your text editor, put a print statement around each line, and assemble the print statements into a program. Of course, make sure you test your program before you submit it.

Note 2: Something to keep in mind in every assignment this semester: Don't use constructs we haven't introduced yet in the semester. This assignment really only needs print statements (probably 12 of them). Even if you know a lot of Python from high school or elsewhere, don't use lists, dictionaries, format statements, f-strings, etc. We'll cover some of that later in the semester, but we haven't yet. Using such things is a red flag because it suggests that you might be getting illegal help from someone or possibly from an AI system. You'll lose points if you don't follow this.

Turning in the Assignment:

The program should be in a file named Initials.py (not your initials; the TAs should be able to run every student's program with exactly the same command). Submit the file via Canvas before the deadline shown at the top of this page. Submit it to the assignment hw1 under the assignments sections by uploading your Python file.

Test your code. The TAs must be able to execute your code. It must also contain a header with the following format. (This means that these comments should at the top of your Initials.py file, not in your program output.)

# File: Initials.py
# Student: 
# UT EID:
# Course: CS303E
# 
# Date:
# Description of Program: 
The date can be the date you submit. The Description of the Program should be a few sentences describing what it does, so that someone can understand what your program does without reading the code. Don't write a book! This is only to say what it does, not how it's programmed in any detail. For example, in my version of this program I might include the description: "Prints my initials (W.D.Y.) in large letters of width 12 and height 10 characters." The idea is that you (or someone else) looking at this program in a year will know immediately what it's supposed to accomplish, though not all of the picky details. Also, this program is simple enough that it doesn't require many internal comments; but that won't be true for later assignments.

Just to remind you: if you submit multiple times to Canvas, it will rename your file name to something like Initials-1.py, then Initials-2.py, etc. Don't worry about that; we'll always grade the latest version.

Programming Tips:

Many assignments this semester will include this section called Programming Tips. In general, these are not hard requirements about this specific assignment; they are suggestions to help you become better programmers. So read and apply them!

Follow directions carefully: One of the most important skills for any programmer is to be able to implement a specification given to you by someone else. You should follow the specification exactly, unless you're explicitly given freedom to improvise. If a specification is ambiguous, you should talk to your client to clarify. That's called "requirements analysis" (among other names). So, if something is unclear, ask (preferably on Ed). If you don't follow the specification, don't be surprised when you lose points. If we say that you need some feature, don't push back; just do it.