Question

In: Computer Science

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.

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

Solutions

Expert Solution

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!")


Related Solutions

1.            Use the following table to calculate the expected value. The following table describes the possible...
1.            Use the following table to calculate the expected value. The following table describes the possible outcomes and their associated probabilities. x P(x) ($20) 0.05 ($5) 0.1 $0 0.15 $10 0.35 $15 0.2 $30 0.15                 The first 2 outcomes are losses (negative values).                 What is the expected value of this probability distribution?                 (1 point) 2.            In a certain school (enrollment in the school is well over 1000 students), 40% are male. If you randomly select 8 students:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT