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

Additional notes for A4
• 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 6 Years Ago by WaltP: Added CODE Tags -- there's my first help. Do it yourself next time.

This article has been dead for over six months. Start a new discussion instead.