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
Give a command that will create a file named listing.dat, in your current (commandsAsst) directory, containing a list of all the
ss7ja [257]

Answer:

Following are the command to this question:

"ls -a ~/UnixCourse/fileAsst > listing.dat"

Explanation:

The above-given code will create a file, that is "listing.dat", and this file will be created in your current directory, which will include the list of all files in the file-asst directory.

In this, Is command is used that uses the directory that is "UnixCourse/fileAsst" and inside this, it will create the "dat" file that is "listing".

8 0
4 years ago
What is a google search query that will search for xml files on the domain example.Com
Natali [406]

Answer:

filetype:xml AND site:example.Com

Explanation:

For this specific scenario, we will use three advanced google's search modifiers: filetype, site & AND

filetype:<em>[abc]</em>

Limit results to files matching the [<em>abc</em>] extension, like <em>pdf</em>, <em>txt</em>, <em>jpeg</em>. In this example xml.

site:<em>[domain]</em>

Limit results to websites containing the [<em>domain</em>] in the url, like .edu, <em>.gov</em>, <em>.brainly.com</em>. In this example example.com.

<em>[condition1] </em>AND <em>[conditon2]</em>

Limits results to those matching both conditions joined by the <em>AND. </em>In this example, the search results must match both filetype AND site domain.

Joining all conditions in a single query:

filetype:xml AND site:example.Com

8 0
3 years ago
How do i add a blog to my wordpress site?
jek_recluse [69]
From the Dashboard, choose Pages→Add New                                             Type a name for the page in the text box toward the top of the page.     <span>Leave the text box blank.
</span>



5 0
3 years ago
The Circular Flow Model includes serveral actors. Which of the following is NOT listed in the Circular Flow Model?
Ierofanga [76]
I believe it would be Charities

4 0
3 years ago
Is a pocket watch consider a computer
gulaghasi [49]

Answer:

I don't think a pocket watch is considered a computer based off of my logic. Other people may think differently tho.

Explanation:

7 0
3 years ago
Other questions:
  • What is an advantage of sharing documents in PDF format instead of Word format?
    6·2 answers
  • I'm a number less then 40000.all my digits are multiples of 3.my first third a d fifth digits are the same both of my thousands
    10·1 answer
  • After reading the article, "The Impact of Technology", answer the following question.
    14·1 answer
  • Which of the following is not true about a computer byte? A) It is made up of 8 bits. B) Each letter of the alphabet is stored i
    15·1 answer
  • If your computers normal zoom is 100, but it looks like its at 500, how do you stop that? my invisioned thing isn't on, neither
    9·1 answer
  • Technician A says that almost every part of a vehicle is somehow powered by or controlled by an electrical or electronic system.
    9·2 answers
  • Which of these identifies the intersection of row 16 and column D?
    14·1 answer
  • If you were creating a program that would convert Fahrenheit to Celsius, which kind of variable would you want to use? a string
    7·2 answers
  • Name 3 things that you use daily that are considered computers?
    6·1 answer
  • Write a function assoc_list(l) that, given a list l, returns a list of tuples where the first integer represents the element of
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!