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
OLEGan [10]
3 years ago
6

Implement a recursive method named power that takes 2 integer parameters named base and expo. The method will return the base ra

ised to the power of expo.
Computers and Technology
1 answer:
nika2105 [10]3 years ago
3 0

Answer:

def power(base, expo):

   if expo == 0:

       return 1

   else:

       return base * power(base, expo-1)

Explanation:

*The code is in Python.

Create a method called power that takes base and expo as parameters

Check if the expo is equal to 0. If it is return 1 (This is our base case for the method, where it stops. This way our method will call itself "expo" times). If expo is not 0, return base * power(base, expo-1). (Call the method itself, decrease the expo by 1 in each call and multiply the base)

You might be interested in
Which was cited as a reason why Google became so popular?
kupik [55]

Answer:

Google became successful because its founders were well-connected. Google was the world's first and best search engine. Google changed the world by solving an old problem in a new way. Google's other products are now more important to its success than search.

Explanation:

3 0
3 years ago
________ software consists of operating systems, utilities, device drivers, and language translators.
Hunter-Best [27]

Answer:

"System"

Explanation:

<u>System</u> software consists of operating systems, utilities, device drivers, and language translators.

(not much explanation as it was a fill in the blank which explains itself haha)

Have a nice day!

    I hope this is what you are looking for, but if not - comment! I will edit and update my answer accordingly. (ノ^∇^)

- Heather

3 0
2 years ago
Implement the following logic in C++, Use appropriate data types. Data types are represented as either numeric (num) or string.
ICE Princess25 [194]

Answer:

Follows are the modified code in c++ language:

#include<iostream>//header file

#include<string>//header file

using namespace std;

int main()//main method

{

string name,address, MSG_YES, MSG_NO;//defining string variable

int item,quantity,size=6, i=0;//defining integer variable

double price;//defining double variable  

int VALID_ITEM[]={106,108,307,405,457,688};//defining integer array and assign value

double VALID_ITEM_PRICE[]={0.59,0.99,4.50,15.99,17.50,39.00};//defining double array and assign value

bool foundIt=false;//defining bool variable  

MSG_YES="Item available";//use string variable to assign value

MSG_NO = "Item not found"; //use string variable to assign value

cout<<"Input name: ";//print message

cin>>name;//input value in string variable

cout<<"Input Address: ";//print message

cin>>address;//input value in string variable

cout<<"Input Item: "<<endl;//print message

cin>>item;//input value in string variable

cout<<"Input Quantity: "<<endl;//print message

cin>>quantity;//input value in string variable

while(i <size)//defining while that checks i less then size  

{

if (item ==VALID_ITEM[i]) //use if block to match item in double array

{

foundIt = true;//change bool variable value

price = VALID_ITEM_PRICE[i];//hold item price value in price variable  

}

i++;//increment the value of i

}

if (foundIt == true)//use if to check bool variable value equal to true

{

cout<<MSG_YES<<endl;//print value

cout<<"Quantity "<<quantity<<" at "<<"Price "<<price<<"each"<<endl;//print value

cout<<"Total"<<quantity*price;//calculate the total value

}

else//else block

cout<<MSG_NO;//print message  

}

Output:

please find the attached file.

Explanation:

In the above given C++ language modified code, four-string variable " name, address, MSG_YES, and MSG_NO", four integer variable "item, quantity, size, and i", and "integer and double" array is defined, that holds values.

In the string and integer variable "name, address, and item, quantity", we input value from the user-end and use the while loop, which uses the if block to check the "item and quantity" value from the user end and print its respective value.

6 0
3 years ago
See if you can do better then I did
never [62]

Answer:

no i can't do better ggs

Explanation:

im not smart (also I did answer the question ;) )

8 0
2 years ago
You are part of a testing team at a software business. Your job is to see how many concurrent users the system can host and how
damaskus [11]

Answer:

The right approach is Option b (volume testing).

Explanation:

  • A non-functional trial that has been conducted throughout a results evaluation where even a large amount of information becomes accessible to something like the program, would be determined as Volume testing.
  • The application functionality has been analyzed by determining the maximum volume throughout the database.

Other options are not related to the given query. So the above is the right response.

5 0
3 years ago
Other questions:
  • A collection of related instructions organized for a common purpose is referred to as
    6·2 answers
  • Scientific models can be used for a variety of different purposes. Which of the following statements about scientific models is
    7·2 answers
  • Consider the formula: G=D+(A+C^2)*E/(D+B)^3 Show the order that a processor would follow to calculate G. To do so, break down th
    10·1 answer
  • You have been hired by Beta Airlines to help them with their flight prices. You are to create a 10 x 10 2D array (also called a
    10·1 answer
  • You work in the Accounting department and have been using a network drive to post Excel workbook files to your file server as yo
    15·1 answer
  • If I wanted to include a picture of a dog in my document, I could use _____. SmartArt WordArt clip art AutoCorrect
    13·1 answer
  • When a climbing distance of __________, landing platforms must be in place every __________ feet. Platforms will be offset from
    12·1 answer
  • Rtjfifjjir<br> jhjjbkjkjjgggjhvhjvhf
    9·1 answer
  • You are writing a program to help compare two sports teams. A sample member of the list scores is [2. 5] where your team scored
    5·2 answers
  • Which Internet connection type tends to use shared bandwidth?<br> Cable<br> Dial-up<br> DSL<br> ISDN
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!