1. Ask the user for a number and print that many '*' characters in a vertical line. Your program will have in-line documentation (a header and in-line comments). Give your program an appropriate name.
For example:
5
*
*
*
*
*
2. Ask the user for a number and print that many '*' characters in a horizontal line. You are going to have to override the default function of print(). Here's how to avoid the newline character from printing: print('*', end='').Your program will have in-line documentation (a header and in-line comments). Give your program an appropriate name.
For example:
5
* * * * *
3. Ask a user for a number and print a solid square of '*' characters. Your program will have in-line documentation (a header and in-line comments). Give your program an appropriate name.
For example:
5
*****
*****
*****
*****
*****
Note, because of HTML, that 5x5 square may look like a rectangle.
Note, don't multiply strings. I know it works, but it's not going to help you understand nested loops.
4. Your teacher needs help calculating the class average. Your application will ask how many students are in the class, and it will then accept that many number of grades, and calculate the class average. Your program will have in-line documentation (a header and in-line comments). Give your program an appropriate name.
5. Write a password checker. Your password checker will first ask for a password, then repetitively ask the user to guess at the password. When the user types the same password, acknowledge that the right password was provided. Your program will have in-line documentation (a header and in-line comments). Give your program an appropriate name. DO NOT USE AN IF STATEMENT.
6. Write a program that asks for a numeric range. For all the numbers in that range, calculate and display the square, square root and cube of the numbers. Your program will have in-line documentation (a header and in-line comments). Give your program an appropriate name.
1. A ball is dropped from a height of x. It rises 2/3 of the previous height on each bounce. Display the height of the bounce and count the number of bounces until you reach 0 height. Your program will have in-line documentation (a header and in-line comments). Give your program an appropriate name. Please note, you should be getting numbers in scientific notation very quickly. If you want to look at the whole number (for example: 0.00000135656590257249139855398427367827451917037251405417919158935546875) please add this to the top of your code:
from decimal import Decimal
and then when you output your answer, modify this code(assuming your variable is called height):
print(Decimal.from_float(height))
2. If there are 10 animals in a lab and enough food for 1000 animals, and every hour the number of animals doubles and enough food for another 4000 animals is added, determine when the population exceeds its food supply.
1. Draw a triangle of * characters. Your program will have in-line documentation (a header and in-line comments). Give your program an appropriate name.
Summative Evaluation
If you can't see the document, please read: You Do Not Need Permission To View Any Documents.