Take home practice for midterm 1 Spring 2009.doc

Take home practice for midterm 1 Spring 2009.doc - to the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Take home practice for midterm 1 Spring 2009 You are to design a class that would represent a given temperature in Fahrenheit to different units. Given the following UML representation of a class write the C++ code for the class: Write a client/driver program to prompt and read the temperatures in Fahrenheit and calculate the temperatures for different units and print a 3-column table showing temperatures in Fahrenheit, Celsius, and Kelvin. Write a function that receive 3 integer numbers and returns the rounded integer average of the 3 to the calling program. Write a function that receive 2 float numbers (x and y) and returns the sum of squared (x 2 + y 2 ) of the 2
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: to the calling program. Write a function that receive 3 arguments (an integer, a long and a string) representing a persons age, id and name and print a report nicely formatted using setw() and other iomanip formats. Temp_Convertor- Celsius : double- Fahrenheit : double- Kelvin : double + Set_Fah(double ): void // Sets Fahrenheit to the given value + Print():void // prints the temperatures in Fahrenheit, Celsius and Kelvin separated by a tab + To_Kelvin():double // Calculates and sets temperature to Kelvin Tk = Tc + 273 + To_Celsius():double // Calculates and sets temperature to Celsius Tc = 5/9*(T f-32) Temp_Convertor() Temp_Convertor (double )...
View Full Document

Ask a homework question - tutors are online