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
beks73 [17]
3 years ago
6

The following statement calls a function named half. The half function returns a value that is half that of the argument. Write

the function.
double half (double& number)
{
double half, number;
half = number / 2;
return half;
}
Computers and Technology
1 answer:
Olenka [21]3 years ago
6 0

Answer:

double half (double number)    //to pass by reference is not important here

{

double half;          //number again should not be declared here

half = number / 2;        

return half;

}

int main()

{

    cout<<half(50);

}

Output :

25

Explanation:

As not mentioned in the question, any data type could have been used like int , float or double. Method half() takes a double variable as parameter which is passed as value as we don't need to make the change at the same address we need value of that argument only. A variable half of double type is declared which will hold the half value. Number is not required to declared again here as it is passed by argument. Then the number is divided by 2 and half is returned.

You might be interested in
Select the correct answer.
Vladimir79 [104]

Answer:

I think make a copy maybe

Explanation:

4 0
3 years ago
Read 2 more answers
The smallest network
katrin [286]

Smaller networks include LANs or MANs.

Hope this is what you were looking for!

3 0
3 years ago
Describe two measures you can use to evaluate whether an attachment in a message is reliable to open.
meriva
<span>If a attachment is not reliable to open, terrible effects can happen, peradventure it may have a virus or even malware that can destroy a computers software. 

To avoid this and stay on the safe side, try the following:-

- Open it in protected view 
- Do not save the attachment on your computer 
- Look at the author and read the message carefully to make sure it is not biased. 
- Open it on a flash-drive </span>
8 0
3 years ago
Read 2 more answers
Inserting diagrams into documents can help readers better understand document text. True or False?
Masja [62]
It's true because you can get a better understanding when looking at the evidence.
4 0
3 years ago
1.is there a digital way to mark your favorite website in the internet?Expound your thoughts.
charle [14.2K]

Yes, there is a way to mark your favourite website on the internet by adding it to bookmark

Explanation:

No, I didn't find it difficult to create a bookmark.

It was easy you just have to click on the bookmark button

5 0
3 years ago
Other questions:
  • 3. By eliminating data redundancy, you're enforcing data A. validation. B. integrity. C. consistency. D. accuracy.
    14·2 answers
  • Using a windows computer, to make a window wider, you would move the pointer until it changes to the horizontal resize shape and
    6·1 answer
  • Explain how a monitor can display the letters that you type on a keyboard. (Hint: Three Basic Computer Functions) *
    11·1 answer
  • The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09
    11·1 answer
  • Which of the following blocks allows a user to enter text in a text box in App Inventor?
    6·1 answer
  • Tawni made some changes to her file and wants to save the changes in a document with a different title. How can she do this?
    14·2 answers
  • An operating system that allows a single user to work on two or more programs at the same time is what type of OS?
    14·1 answer
  • Write a C program that reads two hexadecimal values from the keyboard and then stores the two values into two variables of type
    15·1 answer
  • Explain how power surges can affect computers and how this problem can be minimised or removed<br>​
    9·1 answer
  • Which type of a computer can be assembled using a monitor, a keyboard, a cpu, speakers, a printer and a mouse?.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!