1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ganezh [65]
3 years ago
15

Do the same exercise but this time use the value returning function. Here is the skeleton of the main function. Write functions

definition according to the function call. Note: Do not change the main(). Copy it as it is. Must define the function after the main(). Make sure you write the function prototype before main(). // function prototype.
Computers and Technology
1 answer:
AfilCa [17]3 years ago
3 0

Answer:

The function prototypes are as follows:

<em>int findSum(int fn, int sn, int tn);</em>

<em>int findMin(int fn, int sn, int tn);</em>

<em>int findMax(int fn, int sn, int tn);</em>

The functions are as follows:

int findSum(int fn, int sn, int tn){

   return fn+sn+tn;}

int findMin(int fn, int sn, int tn){

   int min = fn;

   if(sn<=min && sn<=tn){

       min = sn;    }

   if(tn <= min && tn <= sn){

       min = tn;    }

   return min;}

int findMax(int fn, int sn, int tn){

   int max = fn;

   if(sn>=max && sn>=tn){

       max = sn;    }

   if(tn>=max && tn>=sn){

       max = tn;    }

   return max;}

Explanation:

Given

See attachment 1 for the main function

Required

Write the following functions

  • findSum
  • find Min
  • findMax.

The following represents the function prototypes

<em>int findSum(int fn, int sn, int tn);</em>

<em>int findMin(int fn, int sn, int tn);</em>

<em>int findMax(int fn, int sn, int tn);</em>

This declares the findSum function

int findSum(int fn, int sn, int tn){

This returns the sum of the three numbers

   return fn+sn+tn;}

This declares the findMin function

int findMin(int fn, int sn, int tn){

This initialzes min (i.e. minumum) to fn

   int min = fn;

This checks if sn is the minimum

<em>    if(sn<=min && sn<=tn){</em>

<em>        min = sn;    }</em>

This checks if tn is the minimum

<em>    if(tn <= min && tn <= sn){</em>

<em>        min = tn;    }</em>

This returns the minimum of the three numbers

   return min;}

This declares the findMax function

int findMax(int fn, int sn, int tn){

This initialzes max (i.e. maximum) to fn

   int max = fn;

This checks if sn is the maximum

   if(sn>=max && sn>=tn){

       max = sn;    }

This checks if tn is the maximum

<em>    if(tn>=max && tn>=sn){</em>

<em>        max = tn;    }</em>

This returns the maximum of the three numbers

   return max;}

<em>See cpp attachment for complete program which includes the main</em>

You might be interested in
HELPPP I cand find my sound card/driver on my computer, and I cant hear anything, I have tried to update the audio driver, but w
lilavasa [31]

Answer:                                                                                                                          

Explanation had the same problem to be honest when I contacted  windows if you cant see that option is not really possible to do anything I suggest factory reset your pc or windows 10 but keep the files options if you'd like to try this options this helped me out cleaned my hard drive and reset every audio options and mostly anything back so you can try this or search up a  vid I guess

4 0
3 years ago
What is illegal to search on the internet?
Rasek [7]
Child p*rnography, acts of terrorism, how to make bombs ect..
Anything against homeland security.
7 0
3 years ago
Using Word, Maureen is writing an outline of a presentation she plans to give to her company. She will be showing a video during
Grace [21]
You don't need a tool to place images in Word. Simply paste them in your document.
5 0
3 years ago
Read 2 more answers
List the steps in setting up an online banking account
ludmilkaskok [199]
It’s not that hard from what I’ve heard. You may and probably have to show that you’re over the age of 18. Or something I mean I’ve never done it before.
5 0
3 years ago
Read 2 more answers
Type the correct answer in the box. Spell all words correctly.
marissa [1.9K]

Answer:

GIF

Explanation:

The Graphic Interchange Format (GIF) is the image format that supports small animations made out of sequential frames played in sequence and possibly in loops, depending on the parameters saved in the file.

The Animated GIFs are seen everywhere these days on social medias, where people use them to express their emotions in bigger and  more elaborate ways then emoticons.

6 0
3 years ago
Other questions:
  • When computers connect to one another to share information, but are not dependent on each other to work, they are connected thro
    7·1 answer
  • Which are SD card types? Choose two answers.<br> Macro-SD<br> Max-SD<br> MicroSD<br> MiniSD
    5·2 answers
  • What is true about using the reserved word super?
    9·1 answer
  • Which type of software has no restrictions from the copyright holder regarding modifications of the software’s internal instruct
    10·1 answer
  • after clicking the start button on your computer screen desktop what option would you then select to examine system components y
    15·1 answer
  • A non technical kind of cyber intrusion that relies heavily on human interaction and often involve tricking people into breaking
    5·1 answer
  • The _______ displays the name of the open file and the program
    11·1 answer
  • Requirements description:
    6·1 answer
  • Hello guys please help me <br>list and identify the components of computer ​
    15·1 answer
  • Project: Digital Media and Business
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!