Comp 122 Lab 5 Lab Report and Source Code Essay

956 Words May 31st, 2016 4 Pages
COMP 122 Lab 5 Lab Report and Source Code
To Buy This material Click below link http://www.uoptutors.com/comp-122/comp-122-lab-5-lab-report-and-source-code COMP 122 Week 5 iLab
Objectives
Apply structured and modular design principles to write programs that meet written specifications and requirements. Develop a pseudo-code design using appropriate program structure (sequence, selection, repetition and nesting) to solve a given programming problem. Use appropriate selection and repetition statements to implement the design. Create user-defined functions to implement a modular design. Use appropriate parameter passing mechanisms for passing data into and getting data back from functions. Use ostream and iomanip formatting manipulators
…show more content…
Assume the user enters correct data, e.g., the start temperature, end temperature and increment are all integers and the ending temperature is greater than the starting temperature.
The formula to convert Celsius to Fahrenheit is
The formula to convert Fahrenheit to Celsius is
Function Requirements
You must create and use the following functions: displayMenu( ) displays a menu. getMenuSelection ( ) gets the menu selection from the user, upper or lower case ‘C’ for Celsius to Fahrenheit, upper or lower case ‘F’ for Fahrenheit to Celsius, and upper or lower case ‘Q’ to quit. Any other input should get an error message “Invalid selection: try again” and re-prompt for the menu selection. getStartEndAndIncrement( ) gets the start, end and increment values for the table from the user. CtoF( ) converts a Celsius temperature to Fahrenheit. FtoC( )converts a Fahrenheit temperatures to Celsius. displayTable( ) displays a C to F or F to C table given start, end and increment values and the conversion character the user selected.
Additional Requirements
Absolutely NO GLOBAL VARIABLES can be used to implement this program! Any program using global variables will NOT be accepted! Use a switch statement to respond to the user’s menu selection in the getMenuSelection function. After the user selects a valid temperature table option, ask the user to enter start, end, and increment values, then display the

Related Documents