Menu

[Solved]-Python 3 Please Mindful Positioning Hour Minutes Hand Use Loops Assignment Q37177619

In Python 3, please be mindful of the positioning of the hourand minutes hand and to use loops for this assignment.

rite a program named Lastnome firstname_spiral sides, how many times to spiral (the total number of lines to draw), and what

rite a program named Lastnome firstname_spiral sides”, how many times to spiral (the total number of lines to draw), and what percentage of increase to use for each arm of the spiral. The length of the first arm of the spiral is 10, with a heading of zero degrees. that draws polygo spirals. Your program will ask for a number d Figure 1a shows a spiral with 4 sides. 60 iterations, and a 5% increase in length. Figure 1b has 8 sides, 50 iterations, and a 3.5% increase in length Figure 1c has 12 sides, 60 iterations, and a 3% increase in length. The e size() was set to 2 on all these spirals; you can use (pensize(1) if you p Figure lb Figure 1a Figure 1c Part 2: Clock Write a program named Las tnane firstname_clock.py to display a clock face with hands showing the current time. The radius of the clock face (the distance from the center to the hour markers) is 150. The hour hand has length 100, and the minute hand has a length of 120. You may design the clock in one of three ways: using the square cursor shape (hint: stamp) for the hour markers and center of the clock (Figure 2a), using the square cursor shape for the hour markers and adding a circle for the face (Figure 2b), or by drawing small rectangles for the hour markers and center of the face (Figure 2c). The images are reduced in size to fit on the page better. Figure 2a Figure 2c Figure 2b To get the hour and minute, use the following code. Note that the code uses % 12 on the hour to get a number in the range 0 to 11, so both noon and midnight work out to zero. (This makes the calculations much easier, believe it or not!) import datetine hour -datetine.datet ime.non().hour % 12 minutedatetine.datetime.now).ninute Things to Note . I used (circle to draw the clock face. You can use it as well, or draw the circle yourself, or just a 12-sided clock face. The position of the hour hand is a combination of the hour and minute. In the preceding figures (all made at about 8:50 am), the hour hand is not nointing at 8: it is almost all the way to the 9 . Show transcribed image text rite a program named Lastnome firstname_spiral sides”, how many times to spiral (the total number of lines to draw), and what percentage of increase to use for each arm of the spiral. The length of the first arm of the spiral is 10, with a heading of zero degrees. that draws polygo spirals. Your program will ask for a number d Figure 1a shows a spiral with 4 sides. 60 iterations, and a 5% increase in length. Figure 1b has 8 sides, 50 iterations, and a 3.5% increase in length Figure 1c has 12 sides, 60 iterations, and a 3% increase in length. The e size() was set to 2 on all these spirals; you can use (pensize(1) if you p Figure lb Figure 1a Figure 1c Part 2: Clock Write a program named Las tnane firstname_clock.py to display a clock face with hands showing the current time. The radius of the clock face (the distance from the center to the hour markers) is 150. The hour hand has length 100, and the minute hand has a length of 120. You may design the clock in one of three ways: using the square cursor shape (hint: stamp) for the hour markers and center of the clock (Figure 2a), using the square cursor shape for the hour markers and adding a circle for the face (Figure 2b), or by drawing small rectangles for the hour markers and center of the face (Figure 2c). The images are reduced in size to fit on the page better. Figure 2a Figure 2c Figure 2b To get the hour and minute, use the following code. Note that the code uses % 12 on the hour to get a number in the range 0 to 11, so both noon and midnight work out to zero. (This makes the calculations much easier, believe it or not!) import datetine hour -datetine.datet ime.non().hour % 12 minutedatetine.datetime.now).ninute Things to Note . I used (circle to draw the clock face. You can use it as well, or draw the circle yourself, or just a 12-sided clock face. The position of the hour hand is a combination of the hour and minute. In the preceding figures (all made at about 8:50 am), the hour hand is not nointing at 8: it is almost all the way to the 9 .

Expert Answer


Answer to In Python 3, please be mindful of the positioning of the hour and minutes hand and to use loops for this assignment…. . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *