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

Recommended Answers

All 2 Replies

>>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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.