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
nasty-shy [4]
3 years ago
7

Create another method: getFactorial(int num) that calculates a Product of same numbers, that Sum does for summing them up. (1,2,

3 ... num) Make sure you use FOR loop in it, and make sure that you pass a number such as 4, or 5, or 6, or 7 that you get from a Scanner, and then send it as a parameter while calling getFactorial(...) method from main().
Computers and Technology
1 answer:
Mandarinka [93]3 years ago
3 0

Answer:

The program in Java is as follows;

import java.util.*;

public class Main{

public static int getFactorial(int num){

    int fact = 1;

    for(int i =1;i<=num;i++){

        fact*=i;

    }

    return fact;

}

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 System.out.print("Number: ");

 int num = input.nextInt();  

 System.out.println(num+"! = "+getFactorial(num)); }}

Explanation:

The method begins here

public static int getFactorial(int num){

This initializes the factorial to 1

    int fact = 1;

This iterates through each digit of the number

    for(int i =1;i<=num;i++){

Each of the digits are then multiplied together

        fact*=i;     }

This returns the calculated factorial

    return fact; }

The main begins here

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

This prompts the user for number

 System.out.print("Number: ");

This gets input from the user

 int num = input.nextInt();  

This passes the number to the function and also print the factorial

 System.out.println(num+"! = "+getFactorial(num)); }}

You might be interested in
Please I need help with this !!!! <br> Complete the table given below.
UkoKoshka [18]

Answer:

  • DBMS , function - include concurrency, security, backup and recovery, integrity and data descriptions.
  • Software calculator , category - calculator
  • DTP , function - Creating, editing, saving and printing documents.
8 0
3 years ago
Discuss your role as an IT professional in terms of your responsibility to clients, co-workers and society.
Tom [10]

An IT professional is expected to deliver correct installations and programming that are safe from security breaches to clients. To co-workers, teamwork, respect, and brainstorming are needed to work together and achieve results. To society, an IT professional is expected to deliver architectures that do not compromise security and privacy.

An information technology professional could be focused on the hardware or software of systems. It is vital that IT professionals deliver services that are foolproof and not susceptible to attacks.

When working with colleagues, they must cooperate in order to deliver the most efficient services.

Learn more about IT professionals here:

brainly.com/question/14314381

8 0
2 years ago
"You have an interface on a router with the IP address of 192.168.192.10/29. Including the router interface, how many hosts can
SSSSS [86.1K]

Answer:

6 hosts can have IP addresses on the LAN attached to the router interface

Explanation:

Given IP address

=> 192.168.192.10/29

It has a subnet mask of /29 which means it has 3 host bits. This is calculated by subtracting 29 from 32(number of bits in an IPV4)

Since there are 3 host bits,  the total number of possible addresses is given by

=> 2^{3} = 8 possible addresses.

Out of these 8 possible addresses, the first address will be the subnet id and the last address will be the broadcast address.

Therefore, there are only 6 addresses available for the hosts.

<em>Hope this helps!</em>

5 0
3 years ago
) A stub network has ______. (Points : 2) one backup route
jeyben [28]

Answer: One backup router

Explanation:

 A stub network is the type of the packet network that basically describe the computer notwork. It typically capable for sending the complex data in the single network path when the network aware about its destination.

A stub network contain the one backup router as the stub routing is the typically designed for conserve the resources of the local router like the central processing unit (CPU) and the memory. It basically improve the stability of the network in the system.

6 0
2 years ago
In which job role would a course in 3D modeling help with professional career prospects?computer programmer
Aleks04 [339]
This would either be a multimedia artist or a web developer
7 0
3 years ago
Read 2 more answers
Other questions:
  • 2 negative impact of excessive use of computer even in solving mathematical problem.
    11·1 answer
  • Which measure should you take for the periodic maintenance of your computer? You need to invest in a for_______________ the peri
    15·2 answers
  • ​When preparing a representative sample from a list of 200 customers who complained about errors in their statements, a _____ co
    7·1 answer
  • Declare an array named tax rates of five elements of type double and initialize the elements (starting with the first) to the va
    12·1 answer
  • Please Help!! How to code this in Python?
    11·1 answer
  • Write SQL statements for the following: 1. 2. 3. Change the column Z of a table XYZ to now acceptdefault value 9999 Delete a tab
    8·1 answer
  • How are special characters added to a Word document? Check all that apply.
    11·2 answers
  • A. Calculate the diffusion coefficient for magnesium in aluminum at 450°C.
    14·1 answer
  • Write a structured algorithm that prompts the
    9·1 answer
  • How does the Evaluate Formula dialog box help fix errors?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!