CSc 110 - PA 1 - Movies

In this PA, you will be writing three simple programs that print out text. Note that thie programming assignment (PA) is a rather easy one. Not all of the future PAs will be this way. It is simple because we have not yet covered a wide variety of programming concepts, so there’s only so much I can reasonably expect you to be able to program. The PAs will get more challenging, but also more interesting!

Part 1: Course Survey

Remember - a part of this PA is filling out the 110 student survey. Don’t forget to fill this out … it is worth points!

Click here to take the survey

This should only take 5-10 minutes.

Part 2: Movie Scripts

For this part of this assignment, you will write three simple programs. Each program will print out a part of a movie script.

The three separate programs should be named gladiator.py, rogueone.py, and kingdom.py, which correspond to the three movie clips linked below, respectively.

Your program only needs to print the dialogue of the two main characters (with one exception) in the conversation (with one exception for the gladiator script). You only need to print out the first 5 script lines for Gladiator, 6 for Rogue one, and 7 for Kingdom of Heaven. No need to add in the noises or words that are in the background of by other characters (if any). The output of the dialogue must match my solution exactly. In order to do so, follow these rules:

The names of the movies you should use are GLADIATOR, ROGUE ONE, and KINGDOM OF HEAVEN respectively. The character names are MAXIMUS, EMPEROR, and SOLDIER for Gladiator, BODHI and CASSIAN for Star Wars, and KING and BALIAN for Kingdom of Heaven.

Below is an example script. This is from Star Wars, a New Hope. Is is actually the script of this scene from Star Wars, which you should not use. This is just to demonstrate the formatting that I expect.

----- STAR WARS -----


CREATURE: He doesn't like you.

LUKE: Sorry.

CREATURE: I don't like you either. You just watch yourself. We're wanted men. I
          have the death sentence on 12 systems.

LUKE: I'll be careful. 

CREATURE: You'll be dead.

Your task is to create a program for each of the linked move clips that prints out the first 5 parts of the dialogue. You should write each of these programs, and use Gradescope to check if the output is correct.

Part 3: Printing a TIE-fighter

In the this program, you will print out a tie-fighter (an example of this spacecraft is shown above). Name your program tie.py. Your program should ask the user for one number; the width of the tie fighter. The number that your program accepts should control the width of the “arms” that extend out on each side of the tie fighter. The height of the fins and the size of the center can remain the same size regardless of the value that the user enters. Below are several examples of this program running with different input values provided. Your program should match the look of the TIE fighter exactly. You can use the differ tool to check that your output matches.

Enter TIE width:
7

|[                       ]|
|[                       ]|
|[        /=---=\        ]|
|[       /==---==\       ]|
|[///////|== X ==|\\\\\\\]|
|[       \==---==/       ]|
|[        \=---=/        ]|
|[                       ]|
|[                       ]|
Enter TIE width:
15

|[                                       ]|
|[                                       ]|
|[                /=---=\                ]|
|[               /==---==\               ]|
|[///////////////|== X ==|\\\\\\\\\\\\\\\]|
|[               \==---==/               ]|
|[                \=---=/                ]|
|[                                       ]|
|[                                       ]|
Enter TIE width:
5

|[                   ]|
|[                   ]|
|[      /=---=\      ]|
|[     /==---==\     ]|
|[/////|== X ==|\\\\\]|
|[     \==---==/     ]|
|[      \=---=/      ]|
|[                   ]|
|[                   ]|

Notice that the integer read in is read in on a new line, and that there is an empty space between the line where the integer is read in and the first line of the TIE fighter. Try putting a \n at the end of the input prompt string to accept the integer on the next line.. Any integer number 0 or greater should be supported. You don’t need to worry about handling negative numbers, fractions, or numbers with decimals.

You should be using string multiplication to get the sizing of the output correct. You are not allowed to use if-statements or for-loops. We will be checking that your code fulfills the requirements, has good style, etc. Receiving full points on all of the Gradescope test cases does not guarantee you an A.

Comments

Don’t forget to include a header/file comment in your code! Include your name and a description of what the program does. For instance:

### 
### Author: Your Name Here
### Description: Describe your program with one
###              or more sentences of text.
###

Due Date

This PA is due Tuesday September 1, 2020 by 7pm. Turn in all programs via Gradescope. You should try to make sure that all of the test cases pass. If you don’t you will likely lose points. You can still submit without all of the cases passing, but that is not preferable.