Answer:
Following is the definition of the required function:
def powerTo( double first, int second);
if second > 0;
double result = pow(first,second);
return result;
else
return 0;
Explanation:
The explanation for above code is as follows:
- A function named powerTo is defined, having two arguments with data type double and integer respectively.
- A if condition is applied that checks the second parameter.
- If the the condition: second > 0 gets true, a value is returned which is equal to first parameter raised to the second.
- If the condition is if bracket gets false, 0 is returned as a result.
i hope it will help you!
You could get a better deal.
Companies get charged when someone makes a card purchase. So if you pay in cash you could get a better deal. Like when you are buying a car, you can get a better deal because you are paying upfront and on the spot so they wont have to worry about you missing paymenyd
Answer:
if (age < 18) // check condition of variable age is less than 18
minors=minors+`1;
else if (age >=18 && age <=64) //check condition of variable age between 18 to 64
adults=adults+1;
else // check condition of variable age more than 65
seniors=seniors+1;
Explanation:
Here we checks the condition if the variable age is less than 18 then it increment the value of variable 'minors' by 1 i.e, minors=minors+`1;
.
if variable age is 18 through 64 then it increment the value of variable adults by 1 i.e,'adults'=adults+1; otherwise increment the value of variable 'seniors ' by 1 i.e seniors=seniors+1;
Line 2 or line 4 sorry if I’m wrong
Answer:
To transform a program written in a high-level programming language from source code into object code. The first step is to pass the source code through a compiler, which translates the high-level language instructionsinto object code.