Question

Q3)  A day has 86,400 secs (24*60*60). Given a number in the range 1 to 86,400, output...

Q3)  A day has 86,400 secs (24*60*60). Given a number in the range 1 to 86,400, output the current time as hours, minutes, and seconds with a 24-hour clock. For example:70,000 sec is 19 hours, 26 minutes, and 40 seconds.

Q4) Consider a triangle with sides of length 3, 7, and 9. The law of cosines states that given three sides of a triangle (a, b, and c) and the angle C between sides a and b:

c square = a square + b square - 2 multiply a multiply b multiply cos(C) . write python code to calculate the three angles in the triangle.

Write the code and run from Pycharm 2019.

Q5) The radius and mass of the Earth are r = 6378 * 103  meters and ml = 5.9742 * 1024  kg, respectively. Prompt the user to input his or her mass in kg and then calculate the gravitational force (F) and acceleration due to gravity (g) caused by the gravitational force exerted on him / her by the Earth. Consider F = G(m1) (m2) / (r2 ) and F = mg. Let the the universal gravitational constant G = 6.67300 x 10-11 (in units of m3kg-1s-2 assuming the MKS [ meter-kilogram-second] system). Check that the resulting value of g is close to 9.8m/s2.

[ Hint : there are two formulas of F. In one, m2 is the mass in kg of the user. In the other, m is the mass in kg of the user].

code and run from PYCHARM .

Q5) Write a program that displays a NO ENTRY sign, code and run from PYCHARM .

Q6) Write a program that paints a sad emoji with yellow color inside the circle of the emoji. code and run from PYCHARM .

Q7) Write a graphical application that displays a checkboard with 25 squares. ( checkerboard black and white) . code and run from PYCHARM .

Q8) Draw a twelve-pointed star. code and run from PYCHARM.

Q9) Write a program that prompts the user to enter the radius of the rings and draws

an Olympic symbol of five rings of the same size with the colors blue, black, red, yellow, and green. code and run from PYCHARM.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Note:
As per Chegg strict policy & guidelines , I am only allowed to answer first question, please post the remaining questions as separate post, and i will be happy to answer them.Sorry for the inconvenience caused.



Below is the code for the first two questions.

Thanks for the question. Please post the remaining questions immediately so that i can quickly answer them.
==============================================================================

#Q3
time=int(input('Enter a number in the range 1 to 86400: '))
if 1<=time and time<=86400:
    seconds=time
    hours=seconds//60**2
    seconds=seconds%60**2
    minutes=seconds//60
    seconds=seconds%60
    print('{} sec is {} hours, {} minutes, and {} seconds'.format(time,hours,minutes,seconds))
else:
    print('Number not in range')


#Q4
import math
a=float(input('Enter length a of triangle: '))
b=float(input('Enter length b of triangle: '))
c=float(input('Enter length c of triangle: '))

print('Angle A: {0:2f}'.format(math.degrees(math.acos((b**2+c**2-a**2)/(2*c*b)))))
print('Angle B: {0:2f}'.format(math.degrees(math.acos((a**2+c**2-b**2)/(2*a*c)))))
print('Angle C: {0:2f}'.format(math.degrees(math.acos((a**2+b**2-c**2)/(2*a*b)))))


Add a comment
Know the answer?
Add Answer to:
Q3)  A day has 86,400 secs (24*60*60). Given a number in the range 1 to 86,400, output...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Use only if else nested if else only otherwise your answer won't be entertained. Problem 1(b):...

    Use only if else nested if else only otherwise your answer won't be entertained. Problem 1(b): Write a program that gives remainder without using modulus operator and loops. The first number entered will be dividend and second number entered will be divisor. Sample input: 15 6 Sample output: Remainder is 3 In a right triangle, the square of the length of one side is equal to the sum of the squares of the length of the other two sides. Write...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT