ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 5707

Who can do my python homework?

by Axe - 05-19-2016 - 03:24 PM
#1
Welp, this is going to effect my grade heavily since it's going in as a test grade, and I don't know any of this. If you have any knowledge in Python and know how to solve these, do your boy a favor. 

  1. Write a function quadratic(a,b,c) that solves quadratic equations using the quadratic formula: It should take as arguments three numbers a, b, and c from the user. It should print error messages if a is zero, or if the roots are complex. Otherwise it should print the two roots.

2. Write a function polynomialValue(x,coeffs) that evaluates polynomials. It should take two arguments. The first is a number x. The second is a list of coecients ordered from highest to lowest. Let the user determine how many coefficients the polynomial has and then let them enter the coefficients. Create and store the coefficients in a list. Then ask for the value of x. For example, if the polynomial is 2x^4-3x^3+5x^2-2x+4 and we want to evaluate it at x = 2, we would call the function with polynomialValue(2,[2,-3,5,-2,4]) to get the value (2(2)^4-3(2)^3+5(2)^2-2(2)+4  =  28


3. A clerk works in a store where the cost of each item is a positive integer number of dollars. So, for example, something might cost $21, but nothing costs $9.99. In order to make change a clerk has an unbounded number of bills in each of 2 the following denominations:  $1,   $2, $5, $10, and $20. Write a program that takes two arguments from the user, the cost of an item and the amount paid, and prints the change using the smallest possible number of bills.

4. Write a program that will prompt a user to enter a temperature as an integer. Your program will print “it is hot” is the temperature is at least 100, “it is cold” if the temperature is at most 60, and “it is just right” if the temperature is between 61 and 99 inclusive. The program continues to ask for temperatures, and evaluates them as above, until the user enters a temperature of 0, for which the program stops.


5. Define a function called bart() which prints the ASCII art below every time it’s called. Add another function that manyTimes(n) that will accept the number of times to print the art work below, and print it that many times.  

 |\/\/\/|  
 |      |  
 |      |  
 | (o)(o)  
 C      _)
 | ,___|   
 |   /     
/____\     
/      \  

6. Write a function that receives three arguments representing the lengths of its sides of a triangle and determines if the triangle is isosceles, scalene, or equilateral.

7. Write a program that prints a well formatted table on two columns: on the left the integer temperatures between 0 and 100 (Fahrenheit) and in the right column the corresponding Celsius values. For example:
Fahrenheit Celcius
0 -17.7778
1 -17.2222
2 .
3 .
4 -15.5556
.
.
.
100 37.7778


8. Write a program that produces a graphic given below:


[Image: b6yKuGQOuaYaLbPEd6a1HecAKuVfILrlsR2C9ATg...X36D8VR_we]

9. Create a list of 100 random numbers between -100 and 100. In the same program file,  develop the named functions below, that use the random number list created to accomplish the task described for each required function specified below.


a. Function named maxValue() that will determine the maximum value in the generated list. Do not use the in-built Python function, max: construct one yourself.


 b. Function called oddPositiveNumbers() that will count the odd numbers in the list that are also positive.


 c. Function sumMultiples53() that will add all the numbers that are multiples of both 5 and 3 in the list


 d. Function averagePositives() that will find the average of all the positive numbers in the list.


e. Function sumSquaresBeforeFirstEven() that will sum the squares of all the elements in a list up to but not including the first odd number.


10. Create a dictionary for the 50 states of the United States of America plus Washington DC district of Columbia (51 entries) and their populations. [Use official codes for the states e.g. South Carolina is SC, etc). Here is the file with all the data you need: https://drive.google.com/file/d/0B3JAl4NrvV0cNW9ka0NYcnI1ZVE/view?usp=sharing  
The file contents are in this order: StateName, ST(Abbreviation), Population size (as of census 2013), Population rounded to the nearest 10000, Population rounded to the nearest 100000 (but with the zeros omitted). Write and use the drawbar() function to draw a well labeled bar chart to reflect the population sizes of the states, arranged in alphabetic order from AK to WY. Use the state Abbreviations for labels at the bottom, and last column (rounded to nearest 100K) for heights of the columns.
Reply
#2
Asking people if they want to do homework...  :fp:
Reply
#3
(05-19-2016 - 04:18 PM)Kave Wrote: Asking people if they want to do homework...  :fp:

Well, maybe someone enjoys doing Python xD 
Better than doing nothing, I don't know how to do it.
Reply
#4
[Image: 7s6uwwq.png]

Never post again @Axe.
Reply
#5
I would if i was still in school and knew anything about this lmao...
[Image: b964a826bf7328ceab559cc1734971f7.gif]
Reply
#6
(05-19-2016 - 08:07 PM)Lion Wrote: I would if i was still in school and knew anything about this lmao...

Sigh, thanks anyway.
Reply
#7
I can get a friend on who's a python pro, give me like 3 hrs to get home
Dave

[Image: Destrix.gif]

"Give a man a mask and he will show his true face."
Reply
#8
(05-19-2016 - 08:24 PM)Dave Wrote: I can get a friend on who's a python pro, give me like 3 hrs to get home

You'd be a lifesaver man. I need to pass this class. ( This assignment counts as 20% of my final grade ).
Reply

Users browsing: 2 Guest(s)