Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I add 4 more methods to this program while displaying instructions like This program will convert feet and inches into meters and centimeters?

How do I add 4 more methods to this program while displaying instructions like "This program will convert feet and inches into meters and centimeters"? using System; using static system.Console; namespace Methods public class Methods { public static void Main() { string userInput; int feetVal, inchVal; int totalInches; double totalCms; int heightMeter, heightCm; Console.Write("Enter height (feet)"); userInput = Console.ReadLine(); /* Convert to integer type */ feetVal = Convert.ToInt32(userInput); Console.Write("Enter height (inches) "); userInput = Console.ReadLine(); inchVal = Convert.ToInt32(userInput); // once feet has 12 inches totalInches = feetVal * 12 + inchVal; // lets convert the inches to centimeters - once inch roughly is equal to 2.54 centimeters totalCms = totalInches * 2.54; heightMeter = (int)totalCms / 100; heightCm = (int)totalCms % 100; Console.WriteLine("Input height in (feet and inches) {0} feet {1} inches", feetVal, inchVal); Console.WriteLine("Input height int (meter and cms) {0} meter {1} cm", heightMeter, heightCm); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions