Can someone help me with this????

``````/****************************************************/
/* File: name of your file with the source code     */
/*                                                  */
/* Created by: give your name                       */
/* Date: give the date                              */
/*                                                  */
/* Program to find the maximum of three             */
/* floating point numbers                           */
/*                                                  */
/* Inputs: (keyboard)                               */
/*   Three floating point numbers (n & k)           */
/*                                                  */
/* Output:                                          */
/*   Print the largest value on the screen          */
/*                                                  */
/* Algorithm: uses a programmer defined             */
/* function maximum to determine and                */
/* return the largest of three                      */
/* floating point numbers                           */
/*                                                  */
/* See additional notes for A4                      */                                                                             */                                          */
/****************************************************/

#include <iostream>

using std::cout;
using std::cin;
using std::endl;

Declare the function prototype for maximum

int main()
{
Declare number1, number2, number3 as double
cout << "Enter three floating-point numbers: ";
cin >> number1 >> number2 >> number3;

// number1, number2 and number3 are arguments to
// the maximum function call
cout << "Maximum is: "

<< Write the maximum function call << endl;

return 0;  // indicates successful termination

} // end main

// function maximum definition;
// x, y and z are parameters
Write the function definition for maximum
{
double max = x;   // assume x is largest

Write the code to determine the largest value

return max;       // max is largest value

} // end function maximum``````

• The program prompts the user to input three floating point numbers
• The program calls function maximum, passing the numbers as arguments
• Function maximum determines the largest value, then the return statement returns that value to the point at which function main invoked maximum
• The cout statement outputs the returned value

Edited by WaltP: Added CODE Tags -- there's my first help. Do it yourself next time.

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Sumyungi

>>Can someone help me with this????

Help you with what? We don't do homework for you -- that's your job as a student.

What is the problem?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.