Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Goal: Write a program that provides practice in class development and implementation of programs in multiple separate files. Make sure you thoroughly read and understand

Goal: Write a program that provides practice in class development and implementation of programs in multiple separate files. Make sure you thoroughly read and understand the directions before you begin PART 1: Write a program that displays a temperature conversion chart. There should be 6 functions defined as part of a class. print_introduction_message get_conversion_table_specifications print_message_echoing_input fahrenheit_to_celsius fahrenheit_to_kelvin print_table A portion of the code is defined below but not using classes. Add the 4 missing function prototypes and the 4 missing function definitions. Add any private or public variables to the class definition that you decide is needed to complete the program Note To convert temperatures values written in Fahrenheit to Celsius, you subtract 32, multiply by 5 and then divide by 9. To convert Celsius to Kelvin, you add 273.15. /* This program prints out a conversion table of temperatures, after prompting the user for upper and lower bounds of the table in Fahrenheit, and the temperature difference between table entries. */ #include using namespace std; int main() { int lower = 0; /* the lowest Fahrenheit entry in the table */ int upper = 0; /* the highest Fahrenheit entry in the table */ int step = 1; /* difference in Fahrenheit between entries */ /* print a message explaining what the program does: */ print_introduction_message(); /* prompt the user for table specifications in Fahrenheit: */ get_conversion_table_specifications(lower, upper, step); /* print appropriate message including an echo of the input: */ print_message_echoing_input(lower, upper, step); /* Print the table (including the column headings): */ print_table(lower, upper, step); return 0; } /* FUNCTION TO CONVERT FAHRENHEIT TO CELSIUS */ double fahrenheit_to_celsius (int fahr) { return (static_cast(5)/9) * (fahr - 32); } /* FUNCTION TO CONVERT FAHRENHEIT TO KELVIN VALUE */ double fahrenheit_to_kelvin (int fahr) { return ((static_cast(5)/9) * (fahr - 32)) + 273.15; } The program should produce output as given below. Test your program with various inputs. Example output: This program prints out a conversion table of temperatures. Enter the minimum (whole number) temperature you want in the table, in Fahrenheit: 0 Enter the maximum temperature you want in the table: 100 Enter the temperature difference you want between table entries: 20 Temperature conversion table from 0 Fahrenheit to 100 Fahrenheit, in steps of 20 Fahrenheit: Fahrenheit Celsius Kelvin 0 -17.78 255.37 20 -6.67 266.48 40 4.44 277.59 ... ...... ...... ... ...... ...... 300 148.89 422.04 PART 2: Split the program solution for Part 1 into three files: a main program file, conversion_main.cpp a header file called "conversions.h" for the functions " fahrenheit_to_celsius (...)" and " fahrenheit_to_kelvin (...)" an implementation file, conversion.cpp for the prior two mentioned functions. Again, test your program with various inputs. Program Specifications The program you develop must have the following characteristics: It must contain functions It must contain prototypes It must contain class definitions and include private variables in the class It must be commented adequately o Label the section of the program where the prototypes are o Label each function call o Before each function, give a brief description of what the function will do It must contain adequate names for each function It must be split into the indicated files with appropriate filename convention

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sybase Database Administrators Handbook

Authors: Brian Hitchcock

1st Edition

0133574776, 978-0133574777

More Books

Students also viewed these Databases questions

Question

5. Benchmark current training practices.

Answered: 1 week ago