Guest User

Untitled

a guest
Nov 16th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. CS 145 Introduction to Programming for Engineers Fall 2012
  2. Programming Assignment #1: Temperature Conversion Due: Th, Sept. 13, 2012
  3. PURPOSE
  4. 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.
  5. BACKGROUND
  6. 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).
  7. REQUIREMENTS
  8. Write and implement a C++ program that meets the following requirements:
  9. Name the program file Celsius.cpp . Create your main() function within this file.
  10. Create appropriate variables needed to hold the Fahrenheit and Celsius values.
  11. Prompt the user to input a real-number value for the temperature in units of Fahrenheit degrees.
  12. Calculate the temperature in units of Celsius degrees and output this result to the console.
  13. Format the prompts and output to include the units associated with the values requested or provided by your program.
  14. 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.
  15. Comment your code to indicate to the reader what you intend the code to do.
  16.  
  17.  
  18.  
  19. CS 145 Introduction to Programming for Engineers Fall 2012
  20. Programming Assignment #1: Temperature Conversion Due: Th, Sept. 13, 2012
  21. Include the necessary preprocessor directive and associated namespace.
  22. 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.
  23. Use good variable naming conventions.
  24. When your program completes, have it return a value of 0.
  25. 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.
  26. Test your code by first hand-calculating the value that you expect to be returned by your program with the input values.
  27. SUBMISSION
  28. 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