1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
baherus [9]
3 years ago
9

Write Python programs to solve the following two problems. Your programs should be named according to the problem descriptions a

nd pack them into a compression file.
1. Design a class Cannonball to model a cannonball that is fired into the air. A ball has
An x- and a y-position.
An x- and a y-velocity.
Supply the following methods:
A constructor with an x-position (the y-position is initially 0)
A method move(sec) that moves the ball to the next position (First compute the distance traveled in sec seconds, using the current velocities, then update the x- and y-positions; then update the y-velocity by taking into account the gravitational acceleration of -9.81 m/sec2; the x-velocity is unchanged.)
Methods getX and getY that get the current location of the cannonball
A method shoot whose arguments are the angle alpha and the y-velocity as v*sin(alpha); then keep calling move with a time interval of 0.1 seconds until the y-position is approximately 0; call getX and getY after every move and display the position; draw a figure to show the cannonball positions and trajectory.)
Use this class in a program that prompts the user for the starting angle and the initial velocity. Then call shoot. Write the file called "CannonballDemo.py" to demonstrate your program is workable.
Computers and Technology
1 answer:
netineya [11]3 years ago
7 0

no one is gonna write this for you lol, don't know why'd you take python and not pay attention.

You might be interested in
Define cyberstalking ?​
Tanzania [10]

Answer:

Cyber stalking involves using electronic means , including Internet or to stalk or harass a person . I

8 0
3 years ago
Read 2 more answers
What are the keys in all rows that sit between the touch keys
k0ka [10]
I think is the number keys I not sure hope it help
5 0
3 years ago
Write a simple hello world program in python 3
IRINA_888 [86]

Answer:

print("hello world")

Explanation:

a hello world program is simply a program that prints out hello world.

for this you would need to remember to have the same number of brackets on each side and to write print. Also remember when printing to include speech marks.

6 0
3 years ago
Read 2 more answers
What prefix describes a mass that is 1000 times smaller than a gram
yanalaym [24]
Milli as in milligram
4 0
3 years ago
Read 2 more answers
the piece of hardware that contains the circuitry that processes the information coming in to the computer and tells the other h
vagabundo [1.1K]

that sound like the CPU, the central processing unit, it handles the informations and distributes it.

7 0
3 years ago
Other questions:
  • Let K(x, y) denote the statement "x knows y" and D denote the domain of all people. Express the following English sentences as a
    9·1 answer
  • A program called the ______ combines the object program with other programs in the library and is used in the program to create
    5·1 answer
  • One of the main purposes of special effects is to accomplish shots that would be too expensive, too dangerous or just plain impo
    9·2 answers
  • Pls help brainliest
    12·1 answer
  • Can you get accurate
    6·2 answers
  • Which components can be added to a lightning app on custom object (choose 3 answers)A. Visualforce B. Standard Lightning compone
    6·1 answer
  • When the condition of an if statement is false, the computer will return an error message to the user.
    15·2 answers
  • HELP ASAP IF YOU KNOW PYTHON 2!!!
    15·1 answer
  • Help with Java, please!
    5·1 answer
  • Compute the average of a list of user-entered integers representing rolls of two dice. The list ends when 0 is entered. Integers
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!