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
Lesechka [4]
4 years ago
9

Whatâs wrong with the following function definition:

Computers and Technology
1 answer:
sammy [17]4 years ago
3 0

Answer:

The Answer for the given question is

First is  return(average ) statement is not used in the last line in function average .

second not included the parenthesis in adding the value1 + value2 + value3  so include (value1 + value2 + value3 )

Third is not type casting the value  so type cast the value by modify that statement

average = float(value1 + value2 + value3 )/ 3;

Explanation:

In the given code the return type is float that means function should return float value.So adding the statement in the last line return(average ) here  all the parameters are of int type but  "average" is float type and when an int is divided by int, it will return int value. So we have to type cast either denominator or numerator.

average = float(value1 + value2 + value3 )/ 3;

To define any function definition it must follow the proper syntax of function definition

The syntax is :

Returntype functionname(datatype parameter1,datatype parameter 2)

{

//statement

}

For example

int mux(int a,int b)

{

int c;

c=a*b;

return(c);

}

In this the returntype is integer thats why it return integer value c. If return type is void it will not return any value .

So the correct code is

float average(int value1, int value2, int value3)

{

float average;

average = float(value1 + value2 + value3 )/ 3;

return(average);

}

You might be interested in
Most operating systems perform these tasks.
taurus [48]
1, 3




---------------------------------------------------
3 0
3 years ago
Read 2 more answers
Today when Dylan turned on his computer, he noticed that the monitor was very dim. He could still see the desktop icon and text.
Vadim26 [7]

Answer:

B. Monitor backlighting

Explanation:

The computer system is a machine that can digitally receive input, process the inputted data and display and save results. The computer system is a physical system driven by a software component.

The computer hardware components are classified as input unit or devices, output unit, memory and storage unit, and  processing unit. The screen is an output unit of the computer system, it displays the output or result of the processed data.

The power supply to the screen, in this context, is not faulty due to the other screen used in testing the supply and input connectors. The back light on the screen has failed and that is why the brightness can not be adjusted.

3 0
3 years ago
W-11/6=4<br><img src="https://tex.z-dn.net/?f=%20%20%5Cfrac%7Bx%20-%2011%20%7D%7B%206%7D%20%20%3D%204" id="TexFormula1" title="
kozerog [31]

step 1, multiply by 6:

x-11 = 4*6 = 24

step 2, add 11:

x = 35

7 0
3 years ago
Suppose there are 69 packets entering a queue at the same time. Each packet is of size 7 MiB. The link transmission rate is 1.7
svp [43]

Answer:

69.08265412 milliseconds

Explanation:

Lets first convert 7 MiB to bits

7*1024*1024*8=58720256 bits

Now convert bits to Gbits

58720256/10^{9}  =0.058720256 Gbits

Queuing Delay = Total size/transmission link rate

Queuing Delay= \frac{0.058720256}{1.7} =0.03454132706 seconds

Delay of packet number 3 = 0.03454132706*2=0.06908265412 seconds

or 0.06908265412= 69.08265412 milliseconds

7 0
4 years ago
Word wrap is the same as __________ return and means you let the ______________ control when it will go to a new line.
dusya [7]

Word wrap is the same as; Soft Return

Word wrap means that you let the; Computer Control when it will go to a new line

<h3>What is Text Wrapping?</h3>

Text wrapping is simply defined as a process used in MS Word to Wrap a Text around an Image.

Now, the way it is done is by selecting the image you want to wrap text around and then On the Format tab, click the Wrap Text command in the Arrange group, then select the desired text wrapping option to wrap the text.

Finally Word wrap is also same as using soft return and letting the computer control when it goes to the next line.

Read more about text wrapping at; brainly.com/question/5625271

5 0
2 years ago
Other questions:
  • If you’d like to have multiple italicized words in your document, how would you change the font of each of these words?
    7·2 answers
  • Jason is an aspiring filmmaker. He manages finance and makes sure that everyone is involved in the project. Which role is Jason
    12·1 answer
  • Which of the following is a key component to your individual internet safety? government regulations
    13·1 answer
  • Under extreme programming, ________ and ________ are intimately related parts of the same process
    13·2 answers
  • Jeffrey works with a huge database of spreadsheet records each day. To organize and identify these spreadsheets, he wants to ass
    7·2 answers
  • In project integration management, project ______ and _______ are intertwined and inseparable activities
    14·1 answer
  • An Organization Chart to support the Appliance Warehouse case study The SWOT Analysis diagram you performed and created to suppo
    13·1 answer
  • Please explain this code line by line and how the values of each variable changes as you go down the code.
    8·1 answer
  • Technology has had
    10·1 answer
  • you want to upgrade your windows 10 professional computer to windows 11 professional. you begin by checking the hardware and dis
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!