I'm currently stuck with my code and I need assistance please. This is the background of what I am working on:
Mission 5 Background:
Create a function that displays the menu of gases and returns a character (or integer) that represents the choice made by the user. The function should validate the user's input to ensure it is a valid selection.
Create a function the accepts from the user the time traveled in seconds and validates the value before returning it.
Create a function that has two parameters - the gas and the time. The function should compute the distance and return it to the caller.
Gas and its Speed (meters per second)
Carbon Dioxide 258.0
Air 331.5
Helium 972.0
Hydrogen 1270.0
Write a program that displays a menu allowing the user to select one of these four gases. After a selection has been made, the user should enter the number of seconds it took for the sound to travel in this medium from its source to the receiver where it was detected. The program should then report how far away (in meters) the source of the sound was from the detected location.
Input validation:
Check that the user has entered on of the available menu choices.
Do not accept times less than 0 seconds or more than 30 seconds.
When I run the program I get an error and then asks me if i want to run the last successful build. I haven't been programming using C++ for long so I'm still learning.