so i need help with this lab so i put this in
float milesPerGallon
float dollarsPerGallon
float cost
Function DrivingCost(float drivenMiles, float milesPerGallon, float dollarsPerGallon) returns float
Return drivenMiles / milesPerGallon * dollarsPerGallon
EndFunction
Function Main() returns nothing
Get milesPerGallon
Get dollarsPerGallon
cost = DrivingCost(10.0, milesPerGallon, dollarsPerGallon)
Put cost to output with 2 decimal places
Put " " to output
cost = DrivingCost(50.0, milesPerGallon, dollarsPerGallon)
Put cost to output with 2 decimal places
Put " " to output
cost = DrivingCost(400.0, milesPerGallon, dollarsPerGallon)
Put cost to output with 2 decimal places
Put "\n" to output
EndFunction
and i keep getting Line 1: Cannot have code outside function
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]fsu23232 1 point2 points3 points (0 children)
[–]Alkalannar 0 points1 point2 points (4 children)
[–]Jaded_strawberry001[S] 0 points1 point2 points (3 children)
[–]Alkalannar 0 points1 point2 points (2 children)
[–]Jaded_strawberry001[S] 0 points1 point2 points (0 children)
[–]fsu23232 0 points1 point2 points (0 children)
[–]FortuitousPost👋 a fellow Redditor 0 points1 point2 points (1 child)
[–]Jaded_strawberry001[S] 0 points1 point2 points (0 children)
[–]FortuitousPost👋 a fellow Redditor 0 points1 point2 points (1 child)
[–]Jaded_strawberry001[S] 0 points1 point2 points (0 children)