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
schepotkina [342]
2 years ago
15

Who can answer me this one plss little urgent

Computers and Technology
1 answer:
olga nikolaevna [1]2 years ago
3 0

Answer:

C is the answer mostly I guess

You might be interested in
Write a static method that implements a recursive formula for factorials. Place this method in a test program that allows the us
matrenka [14]

Answer:

Written in Java

import java.util.*;

public class Main {

  public static int fact(int n) {

     if (n == 1)

        return n;

     else

        return n * fact(n - 1);

  }

  public static void main(String[] args) {

     int num;

     Scanner input = new Scanner(System.in);

     char tryagain = 'y';

     while(tryagain == 'y'){

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

     num = input.nextInt();

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

     System.out.print("Try another input? y/n : ");

     tryagain = input.next().charAt(0);

}        

  }

}

Explanation:

The static method is defines here

  public static int fact(int n) {

This checks if n is 1. If yes, it returns 1

     if (n == 1)

        return n;

If otherwise, it returns the factorial of n, recursively

     else

        return n * fact(n - 1);

  }

The main method starts here. Where the user can continue executing different values of n. The program keep prompting user to try again for another number until user signals for stoppage

  public static void main(String[] args) {

This declares num as integer

     int num;

     Scanner input = new Scanner(System.in);

This initializes tryagain as y

     char tryagain = 'y';

This checks if user wants to check the factorial of a number

     while(tryagain == 'y'){

This prompts user for input

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

This gets user input

     num = input.nextInt();

This passes user input to the function and also prints the result

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

This prompts user to try again for another value

     System.out.print("Try another input? y/n : ");

This gets user response

     tryagain = input.next().charAt(0);

}        

Download txt
4 0
2 years ago
V.kofiryfh givnyovb (to slove you must go back 3 letters)
Elena L [17]
Im goin to be honest with you i dont understand this question at all can you xplain it alittle more plz cuz if i go back three letters it is o
7 0
3 years ago
In excel what is the biggest disadvantage of copying a worksheet into another workbook?
Mariana [72]
The answer might be wrong and you could get caught
7 0
3 years ago
Write a class named Book containing: Two instance variables named title and author of type String. A constructor that accepts tw
andrey2020 [161]

Answer:

The code to this question can be given as:

Code:

public class Book  //define class.  

{

private String title, author;   //define variable.

Book(String a, String b)  //define parameterized constructor.

{

title = a;   //holding value.

author = b;

}

public String toString()  //string function

{

return title + "\n" + author;    //return value.

}

}

Explanation:

In the above java code firstly we declare the class book that name is already given in the question. Then we declare the private variable that datatype is string author and title. Then we declare the parameterized constructor. In the parameterized constructor we use the private variable for hold constructor parameter value. Then we declare the tostring() function in this function we return value of the title and author variable.

3 0
3 years ago
How do you get stickman worriers
ira [324]
You go online and find the answer
8 0
3 years ago
Other questions:
  • A function operates on this, which may consist of a constant, a cell reference, or another function.
    7·1 answer
  • After the following code is executed what will be displayed on the screen? bool correntEmployee = true; double empSalary = 45000
    7·1 answer
  • If you wish to include a header or footer on all pages in a publication, you will need to insert this by navigating to the _____
    11·2 answers
  • Given a double variable named areaofsquare write the necessary code to read in a value , the area of some square, into areaofsqu
    9·1 answer
  • Select the correct answer.
    15·2 answers
  • Write a program that prints the following 45 pairs of numbers:
    8·1 answer
  • How is geeking out related to the concept of social capital?
    5·1 answer
  • Why can't I access my micro SD card on my Lenovo ThinkPad Yoga 11e? I'm trying to export some PNG files onto my Micro SD card, s
    6·1 answer
  • 7. Which cipher is based on the clues of the physical factors, rather than the hardware or a software cryptosystem
    8·1 answer
  • Which storage is faster than secondary storage​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!