Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CS 145 Introduction to Programming for Engineers Fall 2012
- Programming Assignment #1: Temperature Conversion Due: Th, Sept. 13, 2012
- PURPOSE
- The intent of this assignment is to expose you to writing a program for basic functionality that utilizes input/output, variables, and simple calculations in the C++ programming language. Toward this end, you will write a program that uses a temperature entered in Fahrenheit degrees and converts the temperature to Celsius degrees.
- BACKGROUND
- In scientific calculations, is often common to translate from one temperature scale to another. In order to translate a temperature represented in Fahrenheit degrees to Celsius degrees, the formula is: Celsius = (Fahrenheit – 32) * (5.0 / 9.0).
- REQUIREMENTS
- Write and implement a C++ program that meets the following requirements:
- Name the program file Celsius.cpp . Create your main() function within this file.
- Create appropriate variables needed to hold the Fahrenheit and Celsius values.
- Prompt the user to input a real-number value for the temperature in units of Fahrenheit degrees.
- Calculate the temperature in units of Celsius degrees and output this result to the console.
- Format the prompts and output to include the units associated with the values requested or provided by your program.
- Format the prompts and output in an appropriate and neat manner. You need not worry about formatting the output value itself but merely using appropriate units.
- Comment your code to indicate to the reader what you intend the code to do.
- CS 145 Introduction to Programming for Engineers Fall 2012
- Programming Assignment #1: Temperature Conversion Due: Th, Sept. 13, 2012
- Include the necessary preprocessor directive and associated namespace.
- Use good code formatting with indentation and line spaces as demonstrated by the book. Unlike some examples in the book, be sure to put your opening brace on a separate line.
- Use good variable naming conventions.
- When your program completes, have it return a value of 0.
- Create a file header that uses a multi-line comment to provide the file name, the course, the assignment, programmer name (i.e., yours), and a description of what the program does.
- Test your code by first hand-calculating the value that you expect to be returned by your program with the input values.
- SUBMISSION
- Your programming assignment is due Thursday, September 13, 2012 by 11:55 PM. The completed assignment must be uploaded to Moodle by that time and include your Celsius.cpp file.
Add Comment
Please, Sign In to add comment