In this PA, you will be writing multiple programs that print out ascii art of various famous vehicles: One car, one boat, and one airplane. Each of these programs should accept one or more values from the user which are used to adjust the size of the printout. You should write two programs total.
In this program, you will print out ascii art of the USS Arizona (pictured above).
Name your program arizona.py
.
Your program should ask the user for three numbers: the boat outer length, the inner length (length between the two towers) and the tower height.
The outer length will increase the length of the vessel on either side of the towers/guns, and equal amount.
The middle length will control the length of the ship between the two main towers.
(Note that in the rest of the spec, the “length” may be referred to as “width”).
As you might expect, the last input will control the height of the two main towers of the ship.
Below is a diagram showing what component of the vessel each input value determines.
The house shown in the image has a side width of 7, a middle width of 4, and a tower height of 2. When the width of the sides increase, it actually increases by more than one character in total. It actually increases by 1 character on each side. For the middle, the width actually increases by 2 characters for each 1 width. Take a look at the pattern of the vessel between the two towers. The height of the towers changes in accordance with the third input value.
Also, the height of the two antennae on the two towers should be a function of the two width inputs. The formula to determine the height is:
Use that calculation to determine how many rows tall the antenna should be!
Below are just a few examples of this program running with different input values provided. You will be able to use the differ and/or gradescope to test for correct output.
USS Arizona outer width:
5
USS Arizona inner width:
3
USS Arizona tower height:
1
| |
|##$ $##|
## ##
#..# #..#
\----. #..#......#..# .----/
\ ***|_| |#..#-#-#-##..#| |_|*** /
.__________|____ _......_ ____|______..
`---. --\.
<<#\_______________________________________________________\
USS Arizona outer width:
12
USS Arizona inner width:
7
USS Arizona tower height:
4
| |
| |
|##$ $##|
## ##
## ##
## ##
## ##
#..# #..#
\----. #..#..............#..# .----/
\ ***|_| |#..#-#-#-#-#-#-#-##..#| |_|*** /
._________________|____ _.............._ ____|_____________..
`---. --\.
<<#\_____________________________________________________________________________\
In this program, you will print out ascii art of the wright brother’s flyer (airplane).
It will print out a top-down view of the flyer.
Name your program flyer.py
.
Your program should ask the user for just one number: The size of the flyer.
The program should support any size between 0 and 15.
For the spacing indicated by the red arrows, you’ll have to also come up with a way yo make the parts of the flyer line up correctly.
(Don’t worry about trying to make your wright flyer printout match the above image. Instead, use the test cases provided in the spec, on the differ, and on gradescope)
Below are several examples of this program running with different input values provided.
Wright flyer size:
3
#
#---------#
#---------#
===============================================
H | | | | %H% | | | | H
H | | |**|**%H%**|**| | | H
H | | | | %H% | | | | H
======================%H%======================
| |
+#########
Wright flyer size:
7
#
#---------#
#---------#
=================================================================================================
H | | | | | | | | | %H% | | | | | | | | | H
H | | | | | | | | | %H% | | | | | | | | | H
H | | | | | | | |**|**%H%**|**| | | | | | | | H
H | | | | | | | | | %H% | | | | | | | | | H
H | | | | | | | | | %H% | | | | | | | | | H
===============================================%H%===============================================
| |
+#########+
Notice that the overall size of the flyer changes both in heights and width as the size value changes. The number of rows between the bottom and middle layer, and then the middle and top layer, should be calculated. The formula to follow is:
Another “trick” to getting this correct is figuring out how much whitespace to put before the front and back portions of the flyer. The number of white spaces can change depending on the size input, so you’ll have to use some basic math and reasoning skills to figure out the formula! The width of the front and back parts of the flyer stay a consistent size. You have to calculate the amount of spaces to get those positioned correctly.
You should also include a comment at the top of the code file. The comment should include your name and a short description of what the program does. Below is a template you may use:
###
### Author: Your Name Here
### Course: CSc 110
### Description: Describe your program with one
### or more sentences of text.
###
You should also follow the rules from the style guide.
You should not use any python libraries or features that will not have been covered by the time this PA is due. You should be using string multiplication to get the sizing of the output correct. You are not allowed to use if-statements or 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.
This PA is due on Tuesday, September 7th, at 7pm. Turn both programs via on Gradescope. You should make sure that your final submission passes all of the test cases. Passing all test cases does not guarantee a perfect grade. Your code will also be graded on style and formatting.