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
NeX [460]
4 years ago
8

Write the definition of a method powerto, which receives two parameters. the first is a double and the second is an int. the met

hod returns a double. if the second parameter is negative, the method returns zero. otherwise it returns the value of the first parameter raised to the power of the second parameter.
Computers and Technology
1 answer:
mihalych1998 [28]4 years ago
5 0
       
The case of x⁰=1 is one you shouldn't overlook!

double powerto(double f, int exponent)
{
            if (exponent < 0) { return 0; }
            if (exponent == 0) { return 1.0; }          
            while (--exponent > 0) { f *= f; }
            return f;
}
You might be interested in
(True or False)
Marat540 [252]
True is the right answer.
5 0
3 years ago
Read 2 more answers
If 400 Pa of pressure is applied to an area of 55 m2, which is the resulting force?
Free_Kalibri [48]
Formula is
Force=pressure x area
So the answer would be
400 x 55= 22000N
7 0
4 years ago
Read 2 more answers
When should you close the socket python tcp server client.
Aleksandr-060686 [28]
F socket refers to an open TCP connection, the connection is closed. If a stream socket is closed when there is input data queued, the TCP connection is reset rather than being cleanly closed. The descriptor of the socket to be closed

To close the socket you need to call shutdown() first and then close(), and shutdown takes an argument
4 0
3 years ago
Computer gets bored very easily
Gelneren [198K]

Answer:

that is very interesting

Explanation:

5 0
2 years ago
A(n) ____ is a named collection of data that exists on a storage medium.
MissTica
S a named collection of data that exists on a storage medium<span>.</span>
6 0
4 years ago
Other questions:
  • which of the following is not an operating system? A. leopard B. linux C. firefox D. windows
    11·2 answers
  • The superintendent forbade the students to bring their books and copies in the exam hall. (into direct speech)​
    10·1 answer
  • The following code in a different program is not working properly. The message should display the value of the intCounter variab
    14·1 answer
  • A toolkit is:
    15·1 answer
  • which is the quickest way to change the font color in multiple, randomly located cells in a worksheet?
    6·2 answers
  • Eight what makes one character
    14·1 answer
  • Which of the following components helps to limit the front-to-back movement of the crankshaft? 
    9·2 answers
  • What is binary ????????
    5·2 answers
  • music sites through schools wifi 2020 What is one thing a person should do to stay safe when exercising? 100 pts.!
    10·2 answers
  • Mark just finished reading the cay and must write a book report comparing events in the book to events in his life. based on eac
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!