fixed issue with negative results

Signed-off-by: Michael <michael.lindman@gmail.com>
This commit is contained in:
Michael 2022-02-16 17:51:45 +00:00
parent a35c009f91
commit abe55b8f37
2 changed files with 2 additions and 2 deletions

View File

@ -17,8 +17,8 @@ func main() {
fmt.Println("Creative Computing Morristown, New Jersey")
fmt.Printf("Time - Speed Distance Exercise:")
var car int = rand.Intn(65-40) + 40
var distance int = rand.Intn(20-5) + 20
var train int = rand.Intn(39-20) + 39
var distance int = rand.Intn(20-5) + 5
var train int = rand.Intn(39-20) + 20
fmt.Printf(" A Car traveling %d MPH can make a certain trip in %d hours less than a Train traveling at %d MPH.\n", car, distance, train)
for {
scanner := bufio.NewScanner(os.Stdin)