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]
2 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]2 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
_________________: informal messages that are passed on from person to person
sasho [114]

Answer:

Grapevine is the answer

4 0
2 years ago
ANSWER QUICKLY!
patriot [66]

Answer:

It is bit { measurement used to quantify computer data. }

7 0
3 years ago
The IT director instructed the systems administrator to build a server to support the accounting department's file growth. The I
Mamont248 [21]

Answer:

Option (C) FAT32 File System Type

Explanation:

  • FAT32 File System Type cannot be encrypted by the accounting users.
  • FAT stands for File Allocation Table. It is a file system architecture.
  • The File Allocation Table is an index table which contains the details about each cluster ( disk storage space ).
  • By traversing the File Allocation Table, the operating system gets the details the file ( where it is located ) and the size of the file.
  • The FAT32 file system contains more number of possible clusters.
  • In this system, 32 bits are used to store the total number of possible clusters.
  • In FAT32 file system, the transparent encryption is not supported.
  • So, option (C) is correct.
  • All other options are wrong options.
3 0
3 years ago
You need a version of usb technology that will support older usb devices, of which you have many, as well as newer ones. what wo
andrezito [222]
I would want to see the word compatible in the specs
8 0
3 years ago
Write a program that reads a book (a file in text format), breaks each line into words, strips whitespace and punctuation from t
diamong [38]

Answer:

Following are the code to this question:

file= open('book.txt') #open file

li= {} #define an empty list

for lines in file: # use for loop Split file data into words

   d= lines.lower().strip(' !?').split() #define variable d that Add it to map

   for val in d: #define loop to store data  

       if val not in li: #check value is not in list

           li[val] = 0 #define list and assign value in 0

       li[val] = li[val] + 1 #Sort the book data and add its value  

m = sorted(li.items(),key = lambda x : -x[1]) #sorted value into the m variable  

print(m[:10]) #print value

Output:

please find the attachment.

Explanation:

In the given python code first, we open the file "book.txt", in next line, an empty list is defined, that uses the for loop which can be described as follows:

  • In the for loop is used, that reads the file data, and defines a variable "d", that stores the values into the map.
  • In the next line another loop is used, that check file values, if values are the same type so, it adds values and writes it.  
  • In the last line, m variable is used, that sorts the values and use the slicing to print its value.

4 0
3 years ago
Other questions:
  • A(n) _____ is a common output device for hard copy.
    9·1 answer
  • In the mouse properties Window, you Can
    6·1 answer
  • In a paragraph of no less than 125 words, describe how technology helps business professionals to be more efficient. Include exa
    12·2 answers
  • Which type of link is normally used to interconnect two peripheral modules (pm) in the digital multiplex system (dms)?
    13·1 answer
  • (PLATO) How can hackers obtain a person’s data? Malicious hackers can obtain a person’s data through the method of simple ___ en
    7·1 answer
  • What should you include in a persuasive speech
    14·1 answer
  • PLEASE GO SUPPORT I JUST STARTED 3 WEEKS AGO AND I GET NO VIEWS
    12·2 answers
  • Which of the following is not a storage medium?
    14·2 answers
  • Policies and procedures set by companies are established to :
    15·1 answer
  • Can both mediated interpersonal communication and mass communication has an ability to reach huge number of recipients or audien
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!