In: Computer Science
Python Program
Creating a Program to Calculate the Value of a Ferrari
Assignment Instructions
Implement a program that reads in a year and outputs the approximate value of a Ferrari 250 GTO in that year. Use the following table that describes the estimated value of a GTO at different times since 1962.
Year | Value |
1962-1964 | $18,500 |
1965-1968 | $6,000 |
1969-1971 | $12,000 |
1972-1975 | $48,000 |
1976-1980 | $200,000 |
1981-1985 | $650,000 |
1986-2012 | $35,000,000 |
2013-2014 | $52,000,000 |
Assignment Submission Instructions
Submit a text file containing your Python code and a document containing Python Screenshots of the executed code
import sys
# Input the Year from the user.
year = int(input("Enter the year, you want to find the price of
Ferrari 250 GTO: "))
#Cases
if year < 1962:
print ("Unfortunately, No Ferrari existed then!")
sys.exit() #for exiting the program
elif year <= 1964:
print ("The price was $18,500")
sys.exit()
elif year <= 1968:
print ("The price was $6,000")
sys.exit()
elif year <= 1971:
print ("The price was $12,000")
sys.exit()
elif year <= 1980:
print ("The price was $200,000")
sys.exit()
elif year <= 1985:
print ("The price was $650,000")
sys.exit()
elif year <= 2012:
print ("The price was $35,000,000")
sys.exit()
elif year <= 2014:
print ("The price was $52,000,000")
sys.exit()
else:
print ("The Price data is not available yet!")