#!/usr/bin/env python #This simulator simply evaluates & returns value of the following function: #y = f(x) = -x^4 + 150x^3 - 100x^2 - 75x - 25 import math import sys import time #The sleep interval is the overhead for starting this bulky simulator! time.sleep(20) #Get the value of x from the command-line. x = float(sys.argv[1]) #Evaluate f(x). A = math.pow(x,4) B = math.pow(x,3) C = math.pow(x,2) D = x y = -A + 150*B - 100*C - 75*D - 25 #Write the value of f(x). sys.stdout.write(str(y)+"\n")