Distance Traveled
The distance a vehicle travels can be calculated as follows:
Distance = speed * time
For example, if a train travels 40 miles per hour for three hours, the
distance traveled is 120 miles. Write a program that asks the user for the
speed
Budget Analysis
Write a program that asks the user to enter the amount that he or she has
budgeted for a month. A loop should then prompt the user to enter each of his
or her expenses for the month and keep a running total. When the loop
finishes, the pro
Stadium Seating
There are three seating categories at a stadium. For a softball game, Class A seats cost $20, Class B seats
costs $15, and Class C seats cost $10. Write a program that asks how many tickets for each class of seats
were sold and then displa
Random Number File Reader
This exercise assumes you have completed Programming exercise 7, Random Number
File Writer. Write another program that reads the random numbers from the
file, display the numbers, and then display the following data:
The total of
Mass and Weight
Scientists measure an objects mass in kilograms and its weight in newtons. If
you know the amount of mass of an object in kilograms, you can calculate its
weight in newtons with the following formula:
Weight = mass * 9.8
Write a program th
Falling Distance
When an object is falling because of gravity, the following formula can be used to determine the distance
the object falls in a specific time period:
D = g*t^2
The variables in the formula are as follows: d is the distance in meters, g is
def main():
s = int(input("Starting number of organisms: ")
i = float(input("Average daily increase [%]: ") / 100
d = int(input("Number of days to multiply: ")
first = True
print("Day Approximate\tPopulation")
for p in range(s, d + 1):
if first:
p
def main():
s = int(input("Starting number of organisms: ")
i = float(input("Average daily increase [%]: ") / 100
d = int(input("Number of days to multiply: ")
first = True
print("Day Approximate\tPopulation")
for p in range(s, d + 1):
if first:
print(1,