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
Pls help me its for a grade
SVETLANKA909090 [29]

Answer:

D. -9

Step-by-step explanation:

5f - 6f = 9 \\  - f = 9 \\ f =  - 9

7 0
3 years ago
Read 2 more answers
Can you please explain this?​
Leni [432]

Answer:

The question is giving you pairs of points in space which can be used to define lines. It is then asking you to determine if the lines defined by those points are parallel, perpendicular, or neither.

Step-by-step explanation:

Two key things you need to know to solve this is that the lines will be parallel if their slopes are the same, and perpendicular if one slope is the negative reciprocal of the other (i.e. s_{1} = -s_{2}^{-1})

Let's start with question 11. You are given two pairs of points, each of which describes a distinct line:

(3,5)-(1,1) and (0, 2)-(5, 12)

To find the slope of each pair, take the vertex with the lesser x co-ordinate, and subtract it from the vertex with the greater x co-ordinate.  That will give us a valid Δx and Δy to get the slope.

In the first pair, 3 > 1, so we'll subtract the second point from the first:

s = \Delta y / \Delta x\\s = \frac{5 - 1}{3 - 1}\\s = 4/2\\s = 2

So the first pair of vectors describe a line with a slope of 2.  Let's look at the other pair:

s = \Delta y / \Delta x\\s = (12 - 2) / (5 - 0)\\s = 10 / 5\\s = 2

That also gives us a slope of 2, meaning that the two lines are parallel.

This same process will need to be done for the other three questions.  We can't answer questions 12 or 14 here, as the last point is cut off on the edge of the image.  For question 3 though, one line has a slope of 7/3, and the other 3/7. That puts them in the "neither" category, as one is not the negative reciprocal of the other, but instead the positive reciprocal.

6 0
3 years ago
The domain of an exponential function is
dalvyx [7]

Answer:

real numbers

Step-by-step explanation:

7 0
3 years ago
Read 2 more answers
What are the solutions to the equation 3x2 + 15x = 18?
jok3333 [9.3K]

3x {}^{2}  + 15x = 18

<h2>Divide the entire thing by 3</h2>

x {}^{2}  + 5x = 6

x {}^{2}  + 5x - 6 = 0

<h2>You can find the roots by using the quadratic formula or by using the form x²-Sx+P</h2>

let \:  \alpha \:  and \: \beta  \: be \: the \: roots

<h2>Two numbers whose sum is -5 and product is -6</h2><h2>-6 and +1</h2>

<h2>Your answer is B</h2>

6 0
2 years ago
MIguel is making a trail mix. He Uses five and one third ounces of nuts and two and tree fourths ounces of raisins Which of thes
nydimaria [60]

Answer:

2.58\ more\ nuts\ Miguel\ uses\ than\ raisins.

Step-by-step explanation:

Nuts\ used=5\frac{1}{3}\\\\Nuts\ used=\frac{16}{3}

Raisins\ used=2\frac{3}{4}\\\\Raisins\ used=\frac{11}{4}

difference\ between\ nuts\ and\ raisin=\frac{16}{3}-\frac{11}{4}=\frac{64-33}{12}=\frac{31}{12}\approx 2.58

2.58\ more\ nuts\ Miguel\ uses\ than\ raisins.

6 0
3 years ago
Other questions:
  • From least to greates -4 3/7, -4 5/6, -5 3/7, 4 2/7, 5 1/7
    10·1 answer
  • A bakery sold apple pies for $11 and blueberry pies for $13. One Saturday they sold a total of 38 pies and collected a total of
    8·2 answers
  • Vhen 2.0 moles of magnesium reacts, how many liters of oxygen gas, O2, are needed at STP conditions?
    15·1 answer
  • What is the greatest common facters of <br>33, 198, 330​
    9·2 answers
  • A colony of 21,300 bacteria doubles in size every 260 hours. What will the population be 520
    14·1 answer
  • Let f(x)=(x-2)^3+8 Find the inverse of f(x). Please show steps in written form would be gladly appreciated
    14·1 answer
  • PLEASE HELP PLEASE 9. A lake has an average depth of 4 feet. A new dam has just been completed, and the average depth of the lak
    15·1 answer
  • Find the value of x. Round to the nearest tenth.
    6·2 answers
  • Can someone plz help
    5·1 answer
  • For questions 1 and 2, multiple answers may be selected
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!