// Sample Solution
using System;
namespace ComparisonOperators
{
class Program
{
static void Main(string[] args)
{
double timeToDinner = 4; //6 pm - 2 pm
double rate = 30; //miles per hour
double distance = 95; //miles
double tripDuration = distance / rate; //hours
//double timeToDinner = Math.Ceiling(time);
Console.WriteLine(tripDuration);
bool answer = tripDuration <= timeToDinner;
Console.WriteLine(answer);
if(answer){
Console.WriteLine("Yes, we will arrive before dinner begins!");
} else {
Console.WriteLine("No, we will be late for dinner.");
}
}
}
}
No comments:
Post a Comment