Purchase Solution

A C program to convert Celsius to Fahrenheit

Not what you're looking for?

Ask Custom Question

Program (code.c) & (codev2.c) to convert Fahrenheit to Celsius. Simplistic, DOS based so that I may digest and learn.

Program 1: Ask the user to input a Fahrenheit temperature, as a decimal number. Make clear what the user should enter, for example, "enter a whole number" or "please use the format xxx.xx.". Get the temperature from the user as a float. Calc, convert the temperature to Centigrade. Finally, display the two temperatures. Remember to format floats. The client offered that the algorithm for conversion is, "Centigrade is 5/9ths Fahrenheit minus 32". Results are rounded down (the remainder is ignored).

Program 2: Implements a switch: Offer the user three choices, obtains the choice and display an action based on that choice. One of the actions will include an if..else. Also include a default for incorrect choices.

Layout the planned structure and steps to accomplish the individual programs. Ensure brief, accurate and complete detailed instructions in the form of pseudocode, not code. Construct two brief explanations for the pseudocode. Provide both programs, pseudocode, and code (code in editable text).

Purchase this Solution

Solution Summary

This solution provides a detailed C program that converts Celsius to Fahrenheit. It also provides an example of how to use the switch statement in C. For each of the programs included in this solution there is a detailed explanation of how the program works, a pseudo-code description, and the actual C program source code.

Solution Preview

=== Fahrenheit to Celsius convertor ===

The program to convert from fahrenheit to celsius requires the following three steps:

1) Read the input from the user
2) Convert the value
3) Display the value.

This input, compute, output pattern is quite common in simple programs
so it is good to become familiar with it. The stage for reading the
input from the user involves prompting the user and then getting the
input. In some cases it is desirable to validate the input.

Converting the value requires applying the conversion formula to the
input value to get a new value. The problem statement defined ...

Purchase this Solution


Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.