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
Rashid [163]
3 years ago
9

P**nhub or x-videos or other

Computers and Technology
1 answer:
Colt1911 [192]3 years ago
3 0
U shouldnt be watching them, Idc how old u are.
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
.............. 1010111 needs to be transferred w.ith odd parity and the answer is
notsponge [240]

Answer:

A. 01010111

Explanation:

This is because in odd parity, the number on the far left (the 8th number) would always be a 0

7 0
3 years ago
Read 2 more answers
Consider the following code: <br> x=9 y = -2 z=2<br> print (x + y * z)<br> What is output?
Goryan [66]

Answer:

14

Explanation: The reason why is because adding a negative is pretty much subtracting by 2. 9-2=7. Then multiply 7 by 2 like add 7 to 7 and you get 14.

3 0
3 years ago
What do you think about Naruto?
Natalka [10]

Answer:

AMAZINGGG

Explanation:

because it just is !!

3 0
2 years ago
Read 2 more answers
When you declare a variable of a basic, primitive type, such as int x = 10;, the memory address where x is located holds the ___
Nadya [2.5K]

Answer:

Answer is (d) value of 10

Explanation:

Usually when we write "int x=10;", a memory space is allocated for an integer variable with name x, and content 10.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Impact of computer on education
    6·2 answers
  • Which of the following variable declarations is a correct assignment?
    14·1 answer
  • Which answer best describes an unsubsidized federal loan
    9·1 answer
  • Communications that take the form of electronic junk mail or unsolicited e-mail are referred to as
    13·2 answers
  • To color the h2 heading, what tag would you use?
    6·1 answer
  • You are driving on expressway with three lanes in your direction at a speed lower then
    8·2 answers
  • Exercise#3: Write a ch program that performs the following: Declare a two arrays called arrayA and arrayB that holds integer and
    6·1 answer
  • How does a junction table handle a many-to-many relationship?
    10·1 answer
  • The default print setting for worksheets is________
    13·1 answer
  • What are the 3 dimension of an information system?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!