Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Page ZOOM + BASIC PYTHON PROGRAMMING PURPOSE In this assignment, students will do some basic programming in Python. This assignment will help ensure students have

image text in transcribedimage text in transcribedimage text in transcribed

Page ZOOM + BASIC PYTHON PROGRAMMING PURPOSE In this assignment, students will do some basic programming in Python. This assignment will help ensure students have basics programming skills before starting to put ideas together to create more- complicated programs. Students should also, through this assignment, start getting a feel for "playing around with code;" trying different things to get the output that is been requested. ASSIGNMENT For this assignment, you will submit five documents via Canvas, one for each of the programs written below. Each program is worth 20 points. Each program listed should perform all of the sub-items listed under that program. Submission: Your submission should consist of five .py (Python) documents (this is the native format for a Python program). You may submit the five files in a compressed (zip) folder or you may simply submit each file individually. The five files should include: (1) 1printvars.py. (2) 2pymath.py. (3) 3bigif.py. (4) 4aquote.py, and (5) 5inputeval.py 1. Write a program called 1printvars.py that: a. In a comment on the first line gives your full name (first and last). b. Assigns whatever your first name is to a string variable called FirstName. c. Assigns your year of high school graduation to an integer variable called GradYear. d. Assigns the value 2.899 to a float variable called PriceOfGas. e. Prints these three variables together on one line 2. Write a program called 2pymath.py that: a. In a comment on the first line gives your full name (first and last). b. Calculates a variable called w that is equal to 5 + 10. c. Prints out a statement that "The value of wis (whatever).". i. If this is not already clear, rather than printing "[whatever)", the above statement should print out the actual value of w. Do this same thing for x, y, and z below. ii. Use placeholder syntax to insert your variable value into the print statement. d. Calculates a variable called x that is equal to 4 times the sum of 3 and 7. e. Prints out a statement that "The value of x is (whatever).". Inn nlnnholdor mutny to incort totomont Page ZOOM + f e. Prints out a statement that "The value of x is (whatever).". i. Use placeholder syntax to insert your variable value into the print statement. Calculates a variable called y that is equal to the remainder of 17 divided by 3. g. Prints out a statement that "The value of y is (whatever]." i. Use placeholder syntax to insert your variable value into the print statement h. Calculates a variable called z that is equal to the square root of the product of 5 times 7. i. Prints out a statement that "The value of z is [whatever]!". i. Use placeholder syntax to insert your variable value into the print statement. DATA 2100 HW Minor - Basic Python Programming Page 1 of 2 3. Write a program called 3bigif.py that: a. In a comment on the first line gives your full name (first and last). b. Assigns the value of "dog" to the variable AnimalName. C. Assigns the value of "pigeon" to the variable AltAnimal. d. Includes an if-statement in which... (Hint: You should use both elif and else.) i. If the value of AnimalName is "cat", prints "The animal is a cat." 1. Includes a comment on the same line as this if-statement that explains what the if-statement is looking for (i.e., what would have to be true for the statement to return "true"). ii. If the value of AnimalName is the same as AltAnimal, prints "The animal is a [value of AltAnimal)." iii. Or if the AnimalName is "lemur", prints "I am displeased with the value of AnimalName. iv. But otherwise prints "The animal is not a cat or [value of AltAnimal). Apparently, it is a [value of AnimalName]." o ZOOM + e. Use placeholders to insert the variable values into your print statements. 4. Write a program called 4aquote.py that: a. In a comment on the first line gives your full name (first and last). b. Assigns the value "Phil" to the variable SomeName. c. Uses the len function and the SomeName variable to assign the number of letters in Phil's name to the variable NameLength d. Output the following using a print statement (the print statement should output the quotation marks and the values of the SomeName and NameLength variables where indicated by the [brackets]): "I very much enjoy infinite loops," said [value of SomeName), whose name is [value of NameLength) letters long. i. Review Manipulating Variables' slides, Escape Codes (V). ii. Use placeholders to insert the variable values into your print statement. 5. Write a program called Sinputeval.py that: a. In a comment on the first line gives your full name (first and last). b. Asks the user to input their favorite integer and assigns this value to the variable somenumber Converts somenumber to an integer. d. Outputs the square, square root, and cube root of somenumber, with each output labeled (e.g., "The square of your integer is...") and outputted on a separate line. C Assignment Notes: Your programs should run. If any one of your programs does not run (i.e., you get an error when you try to run it), make a comment in the second line of the program (after the line that includes your name) that states # Program does not run. Complete this assignment on your own; doing otherwise represents a breach of academic integrity. What you submit must represent your own thinking and your own work. Do not look at answers from other students, and do not share your answers with others. Students submitting something other than their own work will receive a 0 on this assignment and be reported to the university for the academic integrity violation DATA 2100 HW Minor - Basic Python Programming Page 2 of 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

Why is the package an important venue for advertising messages?

Answered: 1 week ago

Question

What must happen for a message to be successfully processed?

Answered: 1 week ago