Microsoft Visual C#
Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
bartleby

Videos

Textbook Question
Book Icon
Chapter 2, Problem 5E

Write a C# program named InchesTOCentmeters 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, 3 inches is 7.62 centimeters.

Blurred answer
Students have asked these similar questions
Write an application in Visual Studio with C# that handles a student report card. The application shall save the marks of computer science, math and English. Each subject has a total of 50 marks. If a student obtains at least 75/150 marks, an event will trigger and show a congratulation message on passing the exam. Otherwise, it will display an “F” grade.
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.
Write a program that declares a constant named QUARTS_IN_GALLON which holds the number of quarts in a gallon (4). Also declare a variable named quartsNeeded to represent the number of quarts needed for a painting job, and assign an appropriate value. Compute and display the number of gallons and quarts needed for the job. Display explanatory text with the values—for example, A job that needs 18 quarts requires 4 gallons plus 2 quarts. When submitting the program for testing/grading, assign the value 18 to quartsNeeded.

Chapter 2 Solutions

Microsoft Visual C#

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Algebraic Expressions – Algebra Basics; Author: TabletClass Math;https://www.youtube.com/watch?v=U-7nq7OG18s;License: Standard YouTube License, CC-BY
Python Tutorial for Beginners 3 - Basic Math, Mathematical Operators and Python Expressions; Author: ProgrammingKnowledge;https://www.youtube.com/watch?v=Os4gZUI1ZlM;License: Standard Youtube License