Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C# Visual Studio. CS Write a program that can be used to convert meters into fee

ID: 3665514 • Letter: C

Question

C#

Visual Studio. CS

Write a program that can be used to convert meters into feet and inches. You should use methods to accomplish this. There should be a method for each of the following: 1. Convert meters to feet and 2. Convert meters to inches. Your application should resemble the screenshot below. Challenge: Allow the user to convert from feet and inches into meters. If the meter amount is less than .5, use centimeters instead. Your program should contain the two methods above in addition to methods for each of the following: 1. Convert feet to meters, 2. Convert inches to meters, and 3. Determine if the use of centimeters is necessary, and if so, convert to centimeters.

Explanation / Answer

#include #include #define FEET2CM (30.48f) #define INCHTOCM (2.54f) int main() { float inches = 0.0f; float feet = 0.0f; float centimeter = 0.0f; float meter = 0.0f; printf("Enter your input for meter:"); if( 1 != scanf("%f", &meter) ) { // then, scanf failed perror( "scanf failed" ); exit( EXIT_FAILURE ); } // implied else, scanf successful centimeter = meter * 100.0f; printf("%.f centimeter is equal to ", centimeter); if (centimeter >= FEET2CM) { while (1) { feet++; centimeter = centimeter - FEET2CM; if (centimeter