Question

Write a C# program named Miles-ToEest that declares a named constant that holds the number of feet in a mile: 5280. Also declare a variable to represent the distance in miles between your house and your uncles house. Assign an appropriate value to the variable-for example, 8.5. Compute and display the distance to your uncles house in both miles and feet. Display explanatory text with the values-for example, The distance to my uncles house is 8.5 miles or 44880 feet. Convert the MilesToFeet class to an interactive application named MilesTokeetlnteractive. Instead of assigning a value to the distance, accept the value from the user as input. A. B. (Ctrl-

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE

using System.IO;
using System;

class MilesToFeet
{
static void Main()
{
  
double Feet = 5280.0;
double miles = Feet/5280.0;
Console.WriteLine("The distance in miles: "+miles);
Console.WriteLine("The distance in feet: "+feet);
}
}

Output:

sh-4.3$ mcs *.cs -out:main.exe                                                                                                                                                                       

sh-4.3$ mono main.exe                                                                                                                                                                                

The distance in miles: 9.0

The distance in Feet: 47520.0

Thank You

Add a comment
Know the answer?
Add Answer to:
Write a C# program named Miles-ToEest that declares a named constant that holds the number of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program that calculates the calories burned while running over a given number of miles....

    Write a program that calculates the calories burned while running over a given number of miles. While several factors determine how many calories are burned during a mile run, for this program, 90 calories are burned for every mile of running. The cumulative calories burned during a run can be calculated as: Calories * Distance For example, if a person runs 5 miles, the total calories burned is 450. After 3 hours, the person has burned 2 calories. The program...

  • . CENGAGE MINDTAP Q Search this course OX Programming Exercise 2-3 0 Instructions InchesToCentimeters... Σ. Terminal...

    . CENGAGE MINDTAP Q Search this course OX Programming Exercise 2-3 0 Instructions InchesToCentimeters... Σ. Terminal + 3 inches is 7.62 centimet ers Convert the InchesToCentimeters program to an interactive application named InchesToCentimetersInteractive. 600 vau AWN 1 using static System.Console; 2 class InchesToCentimeters Interactive 3 { static void Main() 5 { 6 const double CENTIMETERS_PER_INCH = 2.54; double inches = 3; Line("{0} inches is {1} centimeters", inches, inches * CENTIMETERS_PER_INCH); Instead of assigning a value to the inches variable, accept...

  • USING PYTHON IDLE 3.4: NEED HELP WITH THIS PLEASE! :( Question #8: You want to determine...

    USING PYTHON IDLE 3.4: NEED HELP WITH THIS PLEASE! :( Question #8: You want to determine the distance to lightning strikes during a storm. This can be measured using the time elapsed between seeing the lightning flash and hearing the thunder. You know that the speed of sound is approximately 1,100 ft/second and 1 mile is 5,280 feet. Write a program named q8.py that prompts the user for the number of lightning strikes to analyze and the number of seconds...

  • Problem: Write a short C++ program that gets the side of a cube and the radius...

    Problem: Write a short C++ program that gets the side of a cube and the radius of a sphere from the keyboard and writes to a file the surfaces of these shapes.             ------------------------------------------------------------------------------------------------------------------------ Your task: implement in C++ the algorithm solution shown below. ------------------------------------------------------------------------------------------------------------------------ Part A (79 points) Algorithm solution (in pseudocode): To accomplish this task, your program will have to take the following steps: 1. Declare a variable named outFile that represents an output stream. 2. Declare a...

  • a) Declare and instantiate an array named scores of twenty-five elements of type int.   (b)Write a...

    a) Declare and instantiate an array named scores of twenty-five elements of type int.   (b)Write a statement that declares an array namedstreetAddress that contains exactly eighty elements of typechar. 2. In a single statement: declare, create and initialize an arraynamed a of ten elements of type int with the values of the elements (starting with the first) set to 10, 20,..., 100 respectively. 3. Declare an array reference variable, week, and initialize it to an array containing the strings "mon",...

  • Write a C# program named ProjectedRaises that includes a named constant representing next year’s anticipated 4...

    Write a C# program named ProjectedRaises that includes a named constant representing next year’s anticipated 4 percent raise for each employee in a company. Also declare variables to represent the current salaries for three employees. Assign values to the variables, and display, with explanatory text, next year’s salary for each employee. Note: For final submission assign the following current salaries for the employees: 25000 for employee 1, 38000 for employee 2, 51000 for employee three. Then next year's salary for...

  • Need this program in C#. Thank you 3/19 Lab11 PartC Dur Scenario/Summary Write a windows console...

    Need this program in C#. Thank you 3/19 Lab11 PartC Dur Scenario/Summary Write a windows console application that holds data about an item in a retail store. Your class should be named Retailltem and should hold data about an item in a retail store. The class will have the following member variables. Description- string holding the description of the item, unitsOnHand - int that holds the number of units in inventory Price - double that holds the price of the...

  • C++ 1. Start with a UML diagram of the class definition for the following problem defining a utility class named Month. 2. Write a class named Month. The class should have an integer field named month...

    C++ 1. Start with a UML diagram of the class definition for the following problem defining a utility class named Month. 2. Write a class named Month. The class should have an integer field named monthNumber that holds the number of the month (January is 1, February is 2, etc.). Also provide the following functions: • A default constructor that sets the monthNumber field to 1. • A constructor that accepts the number of month as an argument and sets...

  • Write a program that calculates the average number of days a company's employees are absent during the year and outputs a report on a file named "employeeAbsences.txt".

    Project DescriptionWrite a program that calculates the average number of days a company's employees are absent during the year and outputs a report on a file named "employeeAbsences.txt".Project SpecificationsInput for this project:the user must enter the number of employees in the company.the user must enter as integers for each employee:the employee number (ID)the number of days that employee missed during the past year.Input Validation:Do not accept a number less than 1 for the number of employees.Do not accept a negative...

  • Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate...

    Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate the number of test scores the user enters; have scores fall into a normal distribution for grades -Display all of the generated scores - no more than 10 per line -Calculate and display the average of all scores -Find and display the number of scores above the overall average (previous output) -Find and display the letter grade that corresponds to the average above (overall...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT