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
trasher [3.6K]
3 years ago
7

Write the definition of a function half , which receives an integer parameter and returns an integer that is half the value of t

he parameter. (Use integer division!) So if the parameter's value is 7, the function returns the value 3. If the parameter's value happens to be 44, the functions returns the value 22.
Computers and Technology
1 answer:
timama [110]3 years ago
7 0

Answer:

The answer to this question can be given as:

Function definition:

int half(int value)

  //function name half with an integer parameter

{

return value/2;    //return integer division.

}

Explanation:

In the above function definition, we define a function that is half. This function returns a value that is an integer. In this function, we pass an integer variable that is value. In this function, we return the value of the parameter in the integer division. for example, if the user passes the value 7 in the function parameter so the function will return 3 because we will return an integer value, not floating-point value.

You might be interested in
Find what the secret message is. Get Brainliest if you are fast and correct.
Firdavs [7]

Answer:

What does your digital footprint say about you?

Explanation:

Just follow the path from the end to the start, that's how I always get mazes.

8 0
2 years ago
Read 2 more answers
PLEASE GO SUPPORT I JUST STARTED 3 WEEKS AGO AND I GET NO VIEWS
Margarita [4]

Answer:

Subbed  :)

Explanation:

8 0
2 years ago
Read 2 more answers
1. Write a high level algorithm for cooking a cheeseburger.
pishuonlain [190]

Answer:

1.  A high level algorithm for cooking a cheeseburger could be:

  1. Heat fry pan
  2. Cook one side of the hamburger
  3. Wait
  4. Turn hamburger upside down
  5. Put cheese over hamburger
  6. Wait
  7. Cut hamburger bread in half
  8. Put cooked hamburger inside bread
  9. End (eat)

2. A detailed algorithm for cooking a cheeseburger could be:

  1. Place fry pan over the stove heater
  2. Turn on heater (max temp)
  3. IF fry pan not hot: wait, else continue
  4. Place raw hamburger on fry pan
  5. IF hamburger not half cooked: Wait X time then go to line 5, else continue
  6. Turn hamburger upside down
  7. Put N slices of cheese over hamburger
  8. IF hamburger not fully cooked: Wait X time then go to line 8, else continue
  9. Turn off heater
  10. Cut hamburger bread in half horizontally
  11. Put cooked hamburger on one of the bread halves.
  12. Put second bread half on top of hamburger
  13. End (eat)

Explanation:

An algorithm is simply a list of steps to perform a defined action.

On 1, we described the most relevant steps to cook a simple cheeseburger.

Then on point 2, the same steps were taken and expanded with more detailed steps and conditions required to continue executing the following steps.

In computational terms, we used pseudo-code for the algorithm, since this is a list of actions not specific to any programming language.

Also we can say this is a structured programming example due to the sequential nature of the cooking process.

7 0
3 years ago
Two numbers are given (numbers are entered from the keyboard). If both numbers are positive, then output their sum, if both numb
AleksAgata [21]

Answer:

The program in Python is as follows:

num1 = int(input())

num2 = int(input())

if num1 >=0 and num2 >= 0:

   print(num1+num2)

elif num1 <0 and num2 < 0:

   print(num1*num2)

else:

   if num1>=0:

       print(num1**2)

   else:

       print(num2**2)

Explanation:

This gets input for both numbers

num1 = int(input())

num2 = int(input())

If both are positive, the sum is calculated and printed

<em>if num1 >=0 and num2 >= 0:</em>

<em>    print(num1+num2)</em>

If both are negative, the products is calculated and printed

<em>elif num1 <0 and num2 < 0:</em>

<em>    print(num1*num2)</em>

If only one of them is positive

else:

Calculate and print the square of num1 if positive

<em>    if num1>=0:</em>

<em>        print(num1**2)</em>

Calculate and print the square of num2 if positive

<em>    else:</em>

<em>        print(num2**2)</em>

3 0
2 years ago
What affect did the Scopes trial have on the school curriculum in Tennessee?
Bad White [126]
D)It did not change the curriculum because Scopes lost the case.
4 0
3 years ago
Read 2 more answers
Other questions:
  • Janice, who is 15, posts a picture of herself drinking alcohol and making an obscene gesture on her social networking page. Whic
    11·2 answers
  • What does this image represent?
    9·2 answers
  • Web and mobile applications are created for users to only read information. True False
    15·2 answers
  • In a Microsoft Office application, what is the area at the bottom of the application screen that contains information about the
    13·1 answer
  • Plato Web Tech B Semester Test- I'll mark brainiest for answers to ALL
    9·1 answer
  • Match each word to its correct meaning.
    11·1 answer
  • In which situations would it be most helpful to filter a form? Check all that apply.
    8·1 answer
  • If you play gta and don't know the song ''Glamorous'' Then what do you even do when you play?
    6·2 answers
  • Can someone please give me timetable managment system with data structures in java?
    11·2 answers
  • PLEASE HELP FIRST ONE TO ANSWER WILL GET BRAINLIEST!!
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!