// pgm20 functions with parameters // and return values // 10/6/16 #include #include #include using namespace std; void hello() { string name; cout << "What is your name? "; cin >> name; cout << "Hello " << name << '!' << endl; return; } int sum2nums(int x, int y) { int sum = x+y; return sum; // return x+y; // another way of doing the same thing } double average(int x, int y) { double avg; avg = sum2nums(x,y)/2.0; return avg; } int main() { // hello(); int num1=5, num2=18; cout << "in main, before call: " << endl; cout << sum2nums(1,3) << endl; int added=sum2nums(num1, num2); cout << "after second call: added is: " << added << endl; cout << "the average is: " << average(num1,num2) << endl; return 0; } /* LAB: Modify the celcius to faranheit program (pgm5.cpp) to calculate the temperature in a function. Write a function that accepts a double which represents a temperature in degrees celcius. The function should convert the parameter into degrees faranheit and return that value. */