applereams
18.09.2019 •
Computers and Technology
Write a c# program named inchestocentimeters that declares a named constant that holds the number of centimeters in an inch: 2.54. also declare a variable to represent a measurement in inches, and assign a value. display the measurement in both inches and centimeters—for example, if inches is set to 3, the output should be: 3 inches is 7.62 centimeters. note: for final submission, set the number of inches equal to 3.
Solved
Show answers
More tips
- S Science and Technology When do we change our clocks?...
- A Animals and plants How to Teach Your Parrot to Talk?...
- F Family and Home How to Remove Fading from Clothes: Tips and Tricks...
- F Food and Cooking How to Make Polendwitsa at Home?...
- F Family and Home Parents or Environment: Who Has the Most Influence on a Child s Upbringing?...
- P Philosophy Unbelievable stories of encounters with otherworldly forces...
- L Leisure and Entertainment How to Choose the Perfect Gift for Men on February 23rd?...
- H Health and Medicine How to Treat Whooping Cough in Children?...
- H Health and Medicine Simple Ways to Lower Cholesterol in the Blood: Tips and Tricks...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
Answers on questions: Computers and Technology
- C Computers and Technology What is the term for the instructions that tell a computer what to do...
- C Computers and Technology The portion of a page left unmarked, left blank or le emory space in a page is called: a) black space o b) white space c) grey space d) clear space o...
- C Computers and Technology In cell b17 enter a function that will count the number of locations the job fair was held in 2018...
- M Medicine Before heading to the tour de france a cyclist had a muscle biopsy in his leg. the tests revealed that the dominant muscle fibers were low in myosin atpase activity and anaerobic...
- C Chemistry Bifenthrin chemical with 0.1mg/l of water solubility contaminated in empty silo malt. to clean it with water pressure machine 2.0 bar. how much water do we need to clean the...
- E Engineering Before performing life data analysis, the the life units (hours, cycles, miles, etc.) must be specified and clearly defined....
- P Physics Before opening the tank valve on an oxygen cylinder which is connected to an oxy-fuel cutting torch, you should turn the diaphragm screw a. all the way out. b. /2 of the way...
- M Mathematics Beginning inventory for the month contained 3,000 units that were 80% complete with respect to materials. during the month, 48,000 units were completed and transferred out. ending...
- E English What is one sentence starter you can use to make sure you include evidence from the text in your written response?...
- P Physics The forces acting on this object are and the net force is balanced, 0 n balanced, 10 n unbalanced, 10 n unbalanced, 0 n...
Ответ:
The C# program for the scenario is given below.
using System;
class InchesToCentimeters
{
static void Main() {
// const is used to declare constant variable of any data type
const double CentimeterInInch = 2.54;
double inch = 3;
double centimeter;
centimeter = inch*CentimeterInInch;
Console.WriteLine( inch + " inches is " + centimeter + " centimeters." );
}
}
OUTPUT
3 inches is 7.62 centimeters.
Explanation:
The program is named InchesToCentimeters. As per the question, this program converts inches into centimeters.
The program is not designed to take any user input. All the variables are assigned values inside the program itself. Hence, no validation is implemented.
All the variables are declared as double as per the conversion factor, 2.54, mentioned in the question.
1.As mentioned, a constant double variable is declared and initialized. The variable is declared using keyword, const. This keyword instructs the compiler that the value of variable will not change. Any variable declared with const keyword is also initialized simultaneously.
2.This variable holds the number of centimeters present in one inch.
const double CentimeterInInch = 2.54;
3.Next, a double variable is declared to hold value of inches to be converted.
double inch = 3;
4.Another double variable is declared to hold value of centimeters.
double centimeter;
5.The value assigned to the variable, centimetre, is computed using the previously declared variables.
centimeter = inch*CentimeterInInch;
6.Lastly, the value of inches and the corresponding value of centimeters is displayed on the output.
Console.WriteLine( inch + " inches is " + centimeter + " centimeters." );
7.The function, Console.WriteLine, inserts a new line at the end after the message is displayed.
8.Another function, Console.Write, can also be used to display the message. This function does not inserts a new line at the end after the message is displayed.
C# is a purely object-oriented programming language and hence, all the code is written inside the class.
The program can be tested for positive double values for inches.
Ответ:
Port 22
Explanation:
The Secure Sockets Layer (SSL) is a session-connection layer protocol that is responsible for data authentication and encryption for internet connections
The default SSH port for is Port 22..
The port 22 is used by SSH to activate encryption of data that is communicated via a public network connection( the public network connection could be a global network, a local network, the internet or internet access, ), hence, VPN functionality is provided.