Question: using System; / / Program Lab 1 C . cs public class Lab 1 C { / / Calculates fuel efficiency based on values entered

using System;
// Program Lab1C.cs
public class Lab1C
{
// Calculates fuel efficiency based on values entered by the user.
public static void Main (String[] args)
{
int miles;
double gallons, mpg;
Console.Write ("Enter the number of miles: ");
miles = Convert.ToInt32(Console.ReadLine());
Console.Write ("Enter the gallons of fuel used: ");
gallons = Convert.ToInt32(Console.ReadLine());
mpg = miles * gallons;
Console.WriteLine ("Miles Per Gallon: "+ mpg);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!