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
yarga [219]
3 years ago
5

Write the definition of a function isPositive, that receives an integer parameter and returns true if the parameter is positive,

and false otherwise. So, if the parameter's value is 7 or 803 or 141 the function returns true. But if the parameter's value is -22 or -57, or 0, the function returns false.
Mathematics
1 answer:
Svetach [21]3 years ago
8 0

Answer:

BEGIN def function isPositive(int parameter)

//test for positivity

if parameter > 0

RETURN true

else

RETURN  false

END def function isPositive

Step-by-step explanation:

A number is a positive integer if it is a whole number and exists between 0 and positive infinity e. g 1, 90000, 42434234 e.t.c. It is a negative integer if it is a whole number and exists between negative infinity and 0(0 may be inclusive). e.g 0, -34342, -6984.

As shown on the first line, to define a function, we begin by writing the name of the function - "isPositive" in this case - followed by a pair of parenthesis which contains the parameter(s) on which the function will act on. In this case, the parameter is an integer - positive or negative.

Line 2 shows a comment describing what happens on the next four lines. i.e  checking whether or not the parameter's value is positive

Then, we write an if-else statement to check whether or not the parameter's value is a positive integer. If the parameter's value is greater than 0, the parameter's value is thus a positive integer then the function will return true. This is shown on lines 3 and 4. Otherwise, the parameter's value is a negative integer, thus the function returns a false as shown on lines 5 and 6.  

The last line in the expression shows the end of the function's definition.

Hope it helps.

You might be interested in
U can help me with this
zvonat [6]
$16.50 since you want to multiply the budget per person by how many people their are

5 0
3 years ago
A line passes through (-2,5) and has slope. What is an equation of the line in point-slope form?
shepuryov [24]

Answer:

Step-by-step explanation:

since the question does not have a given slope you can just put the point into the point slope formula   y-y1 = m(x-x1)  

y-5 = m(x-(-2))

y-5 = m(x+2)

since the slope is not given, leave it like that

4 0
3 years ago
Find the hypotenuse of each isosceles right triangle when the legs are of the given measure. 6 sqrt 2
Gemiola [76]
Isosceles right triangles have two equal sides (a and b) that are not the hypotenuse (c). And when two sides are equal, so are their opposite angles. There are only 180° degrees in any triangles, thus the right angle = 90°, so 90 left for the two equal, means that 2x=90,
x = 45°.

There are several ways to go about solving a triangle like this. The best and easiest is simply to memorize that the hypotenuse is exactly root2 times the other sides. Or, each isosceles side is the hypotenuse (c) ÷ root2
a = b = c \div  \sqrt{2} \\ c  = a\sqrt{2}  \\ c = 6 \sqrt{2} \times \sqrt{2}  = 6 \times 2 = 12
Another way to do it is the longer proof of Pythagorean Theorem:
{c}^{2}  =  {a}^{2}  +  {b}^{2}... \:  \:  c =   \sqrt{({a}^{2}  +  {b}^{2})}  \\
c= \sqrt{({6 \sqrt{2}) }^{2} + ({6 \sqrt{2})}^{2}}  \\ =  \sqrt{(2 \times{(6 \sqrt{2} )}^{2} )}  =  \sqrt{2(36 \times 2)}  \\ c =  \sqrt{144}  = 12

7 0
3 years ago
You hike up a mountain. You climb steadily for 2 hours, then take a 30-minute break for lunch. Then you continue to climb, faste
grandymaker [24]

Answer:

<u>Continuous </u>

Step-by-step explanation:

The graph is considered continuous due to the fact that it can take any amount of height, weight, and temperature. If it was discrete there would be a limit to your hike.

I really hope this helped you, please be sure to make my answer brainiest. Thank you and have a great night sleep / or have a great day! :D

6 0
3 years ago
What is 37.5 percent of 80
Leya [2.2K]
37.5*0.010=.375 (or press % button on calculator) 
80*.375=30 
7 0
3 years ago
Other questions:
  • Students were surveyed to find out the most popular pizza topping. According to the bar graph, how many students were surveyed?
    14·2 answers
  • Identify the polar coordinates for each value in the table below, discuss the shape and behavior of the graphs, and use this to
    10·1 answer
  • Which answer and why
    12·1 answer
  • Find the volume of the cylinder i just need the answer please help it’s due in 10 mins
    7·1 answer
  • Jennifer belongs to a gym that requires a monthly membership fee of $60 plus an additional $15 fee for each yoga class she atten
    8·1 answer
  • Suppose A ={2, 5, 7, 9, 13, 25, 26}. True or False: <br><br> {1,2,3}⊆A
    7·1 answer
  • I will give brainiest to whoever answers correctly !!
    12·1 answer
  • What is the square root of 31
    10·1 answer
  • A city’s population is currently 150,00. If the population doubles every 30 years, what will the population be 60 years from now
    8·2 answers
  • Mark is building a scale model of his car as shown in the diagram. The actual car has a height of 10 feet and the model has a he
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!