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
Write a C# program named Miles-ToEest that declares a named constant that holds the number of...
Write, compile, and test a class that displays your first name on the screen. Save the class as Name. Write, compile, and test a class that displays your full name, street address and city, on three separate lines on the screen. Save the class as Address. Write a java program which add two numbers and print the result on screen. Save the class as Add2. Write a java program which accepts two numbers from user multiply them and print the...
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...
Create a program (in C, not C++) called lab3.c that declares the following variables and displays their values: Declare a character variable with value 'a', and display the character using printf with %c format. Then add a second printf that displays the character with a %d format. Declare a short int variable with a value set to the maximum value of a short int (the maximum value for whatever machine I happen to use to grade your assignment - so...
C+ Create an application named CarDemo that declares at least two Car objects and demonstrates how they can be incremented using an overloaded ++ operator. Create a Car class that contains the following properties: Model - The car model (as a string) Mpg The car's miles per gallon (as a double) Include two overloaded constructors. One accepts parameters for the model and miles per gallon; the other accepts a model and sets the miles per gallon to 20. Overload a...
C# Create an application named JobDemo that declares and uses Job objects. The Job class holds job information for a home repair service. The class has five properties that include: JobNumber - The job number Customer - The customer name Description - The job description Hours - The estimated hours price - The price for the job Create a constructor that requires parameters for all the data except price. Include auto-implemented properties for the job number, customer name, and job...
. 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...
Challenge: C# Basics Description: Write a C# console application using .NET Core that utilizes constants, variables, data types, operators, expressions, statements, blocks, and control flow. Purpose: This application provides experience in working with basic language features of C#. It is important when working with a new language to understand how it handles its constants, variables, data types, operators, expressions, statements, blocks, and control flow. A good thing to always do with a new language is to build test applications where...
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 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 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",...