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
STALIN [3.7K]
3 years ago
15

Write a function in Java called factorial() that will take a positive integer as input and returns its factorial as output.

Computers and Technology
1 answer:
serg [7]3 years ago
4 0

Answer:

The function is as follows:

public static int factorial(int n){

       int fact = 1;

       for(int i=2;i<=n;i++){

           fact*=i;

       }

       return fact;

   }

Explanation:

This line defines the function

public static int factorial(int n){

This declares and initializes variable fact to 1    

  int fact = 1;

This iterates from 2 to n

       for(int i=2;i<=n;i++){

This line multiplies all integers from 1 to n

           fact*=i;

       }

This returns the factorial

       return fact;

   }

You might be interested in
Malcolm is part of a team developing a new smartphone app to track traffic patterns. Because team members are located throughout
Umnica [9.8K]

Answer:

Virtual team

Explanation:

A virtual team is also known as a remote team, where every member of the team is working from different geographic locations. Usually, the communication channel is through voice/video conferencing or email.

Each member of the team is given unique roles and these roles are delivered optimally within the specified time frame.

For instance, Malcolm does not meet with other members of the team, yet they are working on a project (a smartphone app to track traffic patterns). Following standards that would have applied if they were working at a specific location.

Thanks to Information and Communication Technology (ICT), virtual jobs are on the increase, providing jobs to a lot of people not minding their geographic location.

7 0
3 years ago
Name and describe the two (2) broad categories of files
fenix001 [56]
If it’s computer files, that would be System Software and Application software.

“The System Software is the programs that allow the computer to function and access the functionality of the hardware. Systems software sole function is the control of the operation of the computer.

Applications software is the term used for programs that enable the user to achieve specific tasks such as create a document, use a database or produce a spreadsheet.”
8 0
4 years ago
What do you mean by real time system? Why real time system needs to response within limited time?
Anna11 [10]

Real time system means that the system is subjected to real time, i.e., response should be guaranteed within a specified timing constraint or system should meet the specified deadline. For example: flight control system, real time monitors etc.

4 0
3 years ago
You are building a network and need to connect five computers in an office. They will be on the same network segment and you sho
lilavasa [31]

Answer:

a lan party

Explanation:

because it's your personal party

4 0
4 years ago
Which of the following is the estimate of the minimum amount of time it would take to perform a task? (Points : 2) Minimal durat
kondor19780726 [428]

Answer:

Optimistic duration

Explanation:

The following three concepts are Project management concepts:

Optismitic duration: Estimation of the shortest duration of a task, taking into account the difficulty, etc.

Pessimistic duration: Estamation of the longest duration of a task, taking into account the difficulty, etc

Expected duration: Expected duration of a task, kind of a compromise between the optmistic duration and the pessimistic duration.

Which of the following is the estimate of the minimum amount of time it would take to perform a task?

The answer is Optimistic duration

7 0
3 years ago
Other questions:
  • owen works in a real-estate office. A contract needs to be signed but the client is out of town. What should Owen do?
    14·1 answer
  • True or false? when intel places a sticker on computers showing their chip is inside, they are demonstrating their visible value
    7·1 answer
  • What term best describes the way the dns name space is organized?
    9·1 answer
  • What is the top folder of the file tree called
    5·2 answers
  • A server provides the necessary IP configuration to your network host so the host can communicate on the network. If this servic
    7·1 answer
  • 2 Manter o autocontrole nos ajuda a evitar muitos problemas na nossa vida pessoal e no ambiente profissional. Em se tratando de
    14·1 answer
  • Whats yall favv scary movie
    11·1 answer
  • The photo shows a group of girls reacting to comments they have read about a classmate on a social media site.
    10·1 answer
  • An employee of a large corporation remotely logs into the company using the appropriate username and password. The employee is a
    10·1 answer
  • In C language. Print numbers 0, 1, 2, ..., userNum as shown, with each number indented by that number of spaces. For each printe
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!