Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the following function and bindings in F#, what are the value of finalState and petrol? let drive (petrol, distance) = if distance = far
Given the following function and bindings in F#, what are the value of finalState and petrol? let drive (petrol, distance) = if distance = "far" then petrol / 2.0 elif distance = "medium" then petrol - 10.0 else petrol - 1.0 let petrol = 100.0 let firstState = drive(petrol, "far") let secondState = drive(firstState, "medium") let finalState - drive( secondState, "short") 50.0 and 100.0 100.0 and 100.0 40.0 and 100.0 100 and 39 39.0 and 100.0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started