/*
C# A Beginner's Guide
By Schildt
Publisher: Osborne McGraw-Hill
ISBN: 0072133295
*/
/*
Project 2-1
Talking to Mars
Call this file mars.cs
*/
using System;
public class Mars {
public static void Main() {
double distance;
double lightspeed;
double delay;
double delay_in_min;
distance = 34000000; // 34,000,000 miles
lightspeed = 186000; // 186,000 per second
delay = distance / lightspeed;
Console.WriteLine("Time delay when talking to Mars: " +
delay + " seconds.");
delay_in_min = delay / 60;
Console.WriteLine("This is " + delay_in_min +
" minutes.");
}
}
|