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
AleksAgata [21]
2 years ago
7

Analyze the following recursive method and indicate which of the following will be true.

Computers and Technology
1 answer:
notsponge [240]2 years ago
7 0

Answer:

a) The method runs infinitely and causes a StackOverflowError.

// Return the factorial for a specified index

public static long factorial(int n)

{

if (n == 0)

return 1;

else

return n * factorial(n - 1);

}

b) Invoking factorial(2) returns 2.

// Return the factorial (2)

public static long factorial(int 2)

{

if (n == 2)

return 2;

else

return 2 * factorial(3 - 1);

}

c) Invoking factorial(1) returns 1.

// Return the factorial(1)

public static long factorial(int 1)

{

if (n == 1)

return 1;

else

return 1 * factorial(1 - 1);

}

d) Invoking factorial(0) returns 0.

// Return the factorial(0)

public static long factorial(int 0)

{

if (n == 0)

return 0;

else

return 0 * factorial(0 - 1);

}

Explanation:

You might be interested in
Grouping data in a report will (Points : 4) provide grand totals for your report.
zaharov [31]

Answer: Let you organize and summarize your data.

Explanation: Data grouping is referred as the making a collection or cluster of data in a report .The group is made for the summarization of the information and makes easily understandable according to the subject or field due to the proper organization.

Other given options are incorrect because it does not provide the total of the report content,attractive form of the data or editing function in report.Thus the correct option is summarizing and organizing the data.

3 0
2 years ago
What is the primary purpose of the software package offered by hyper-v called guest integration services?
zysi [14]

Solution:

Guest integration services resolves compatibility issues of certain guest operating systems experiencing non-functioning features.

Data integration service is the employment of a group of services that comply with service-oriented architecture. Data integration service can perform in an N -> 0 latency time period. At the same time, it offers a powerful set of transformation processes for meeting an array of business imperatives. The advantages of employing data integration as an enterprise service include reduced time for marketing, a reduction in total cost of ownership (TCO), and a solution to the obsolete and expensive data-integration patterns presently available in corporate businesses.

This is the required answer.

6 0
3 years ago
What is sytem software?
schepotkina [342]

Answer:

system software is the set of computer programs that controls and manage the operations of computer hardware.

7 0
1 year ago
What is data mining ​
Vesna [10]

Answer:

Data mining is a process of extracting and discovering patterns in large data sets involving methods at the intersection of machine learning, statistics, and database systems.

5 0
3 years ago
Read 2 more answers
There Are Two Programs in this Question who will attempt first i will give brainliest ans reward and big points:-
Korolek [52]

Answer:

here you go ,could only do Question 2.try posting question 1 seperately maybe someone else can also try to help

Explanation:

Question 2.

#include <iostream>

using namespace std;

// class BankAccount

class BankAccount{

  

    // instance variables

    private:

        int accountID;

        int balance;

  

    public:

      

        // constructor

        BankAccount(int accountID, int balance){

            this->accountID = accountID;

            this->balance = balance;

        }

      

        // getters and setters

        void setAccoutnId(int accountID){

            this->accountID = accountID;

        }

      

        int getAccountId(){

            return accountID;

        }

      

        void setBalance(int balance){

            this->balance = balance;

        }

      

        int balanceInquiry(){

            return balance;

        }

};

class CurrentAccount : public BankAccount{

  

    public:

  

        // constructor

        CurrentAccount(int accountID, int balance):BankAccount(accountID,balance){

          

        }

      

        // function amount to withdraw

        void amountWithdrawn(int amount){

            setBalance(balanceInquiry()-amount);

        }

      

        // function to deposit amount

        void amountDeposit(int amount){

            setBalance(balanceInquiry()+amount);

        }

};

class SavingsAccount : public BankAccount{

  

    public:

      

        // constructor

        SavingsAccount(int accountID, int balance):BankAccount(accountID,balance){

          

        }

  

        // function amount to withdraw

        void amountWithdrawn(int amount){

            setBalance(balanceInquiry()-amount);

        }

      

         // function to deposit amount

        void amountDeposit(int amount){

            setBalance(balanceInquiry()+amount);

        }

      

      

};

int main()

{

    // calling function of Current Account

    cout<<"Current Account : "<<endl;

    CurrentAccount current(122,100000);

    current.amountWithdrawn(10000);

    cout<<"Your balance after withdraw : ";

    cout<<current.balanceInquiry()<<endl;

    current.amountDeposit(30000);

    cout<<"Your balance after deposit : ";

    cout<<current.balanceInquiry()<<endl;

    cout<<endl<<endl;

  

    // calling function of Savings Account

    cout<<"Savings Account : "<<endl;

    SavingsAccount saving(125,80000);

    saving.amountWithdrawn(5000);

    cout<<"Your balance after withdraw : ";

    cout<<saving.balanceInquiry()<<endl;

    saving.amountDeposit(20000);

    cout<<"Your balance after deposit : ";

    cout<<saving.balanceInquiry();

    return 0;

}

4 0
2 years ago
Other questions:
  • Explain why this scenario points towards a potential problem with BIOS.
    10·2 answers
  • A _____ is a device that not only provides surge protection, but also furnishes desktop computers and network devices with batte
    7·1 answer
  • Are headphones considered a computer? Why or why not?
    13·2 answers
  • How do the principles behind the Agile Manifesto suggest approaching architecture?A. Architecture emergesB. Architecture is not
    10·1 answer
  • Which of the following are incident priorities?
    9·1 answer
  • Given the following snippet of code, answer the following two questions based on the code: typedef enum {Sun, Mon, Tue, Wed, Thu
    15·1 answer
  • Hey guys im just curious.... whats ur favorite number
    6·2 answers
  • Select three advantages to using digital video.
    5·2 answers
  • Your network has been having problems lately when users are participating in video conferences - the video and audio stutters ve
    13·1 answer
  • Microsoft recommends when that you create passwords with upper and lowercase letters, numbers, symbols, and use at least _______
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!