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
RideAnS [48]
3 years ago
11

PLEASE HELP!! Computer science test

Computers and Technology
1 answer:
tatiyna3 years ago
6 0

Answer:

See Explanation

Explanation:

Given

The attached function

What the recursion does is that; it adds up individual digits from N to 0

Solving (a): Each output when N = 6

For N = 6.

The function returns the following values:

f(6) = 6

Then: 6 + f(5)

Then: 6 + 5 + f(4)

Then: 6 + 5 + 4 + f(3)

Then: 6 + 5 + 4 + 3 + f(2)

Then: 6 + 5 + 4 + 3 + 2 + f(1)

Then: 6 + 5 + 4 + 3 + 2 + 1 + f(0)

Then: 6 + 5 + 4 + 3 + 2 + 1 + 0 = 21

Solving (b): The output when N = 7

Using the same process in (a) above.

The output is 28

You might be interested in
Topic: Drivers ed 100 points and brainliest!
ddd [48]

Answer: Ill explain it!

Explanation: Modern technology is extremely beneficial to drivers because the modern cars have sensors that detect the range of other cars, when they stop and you might not see or be ready for it, your car will slam the brakes for you, this alone saves many lives. Another is like a Tesla with autopilot. Lets say for example one day your really sleepy or dont feel good, its a stress to keep the car straight. You could turn on autopilot and it could assist you with your driving, and their system has shown to be for the most part very beneficial and responsive. I would say another would be cameras above traffic lights watching for speeders and getting their license plates. This is important because people who are being risky and causing hazards on the road will get a fat ticket and will be seeing court. They are less likely to run a red light if they see a camera watching. I hope this helps you!

3 0
2 years ago
True or False <br> Hebrew Bible and the Koran were first written in English.
lilavasa [31]

Answer:

<h2>FALSE </h2>

THE TWO HOLY BOOK, QUR AN AND HEBREW BIBLIE WAS WRITTEN IN THEIR NATIVE LANGUAGES, FOR EXAMPLE, KORAN IS WRITTEN IN ARABIC AND THE BIBLE WAS WRITTEN IN GREEK AND HEBREW. ACTUALLY THEY WERE TRANSLATED SO EVERYONE CSN UNDERSTAND WHAT IT SAYS.

BRAINLIEST PLEASE

❤❤❤❤❤❤❤❤

6 0
2 years ago
Define global variables called highestNum, userInput and sumOfNums and initialize them. In Main call 2 methods: 1) UserData() 2)
Montano1993 [528]

Answer:

Explanation:

The following code is written in Java. It creates the two methods as requested using the Scanner and Random built-in classes in Java. Once the loop is completed and the highestNum is calculated, then the displayResults method is called to print out all the information in the correct format. The output of the program can be seen in the attached image below.

import java.util.Random;

import java.util.Scanner;

class Brainly {

   static int highestNum = 0;

   static int userInput;

   static int sumOfNums = 0;

   public static void main(String[] args) {

       userData();

       displayResults();

   }

   private static void userData() {

       Scanner in = new Scanner(System.in);

       Random rand = new Random();

       System.out.println("Enter a number between 9 and 20: ");

       userInput = in.nextInt();

       if ((userInput >= 9) && (userInput <= 20)) {

           for (int i = 0; i < userInput; i++) {

               int num = rand.nextInt(100);

               if (num > highestNum) {

                   highestNum = num;

               }

               sumOfNums += num;

           }

       }

   }

   public static void displayResults() {

       System.out.println("There were " + userInput + " numbers generated");

       System.out.println("The highest number generated is " + highestNum);

       System.out.println("The sum of the numbers is " + sumOfNums);

       int average = sumOfNums / userInput;

       System.out.println("The average of the numbers is " + average);

   }

}

5 0
3 years ago
The feature that moves text from the right edge of a paragraph to the beginning of the next line as necessary to fit within the
gregori [183]

Answer:

Return Key (Enter Key on Windows)

Explanation:

It is a key on the keyboard that has a downward arrow with corner leftward, it can be used to start a new line of writing.

6 0
3 years ago
What is the autocad term for standard section line symbols?
seraphim [82]
I think the answer is hatch pattern.
8 0
3 years ago
Other questions:
  • 1) If a client requests timestamping every two minutes, how would it look? a) [00:02:00] b) [00:06:00] c) (00:04:00)
    15·2 answers
  • Oxygen-18 has an atomic number of 8. How many neutrons are in this isotope?
    7·1 answer
  • Jason is creating a web page for his school's basketball team. He just finished creating his storyboard. Which tool should he us
    6·2 answers
  • Image
    9·1 answer
  • What do you need to do before you can sort and filter data in a data base?
    12·1 answer
  • A(n) __________ is a server with the original copy of the data that others need.
    12·1 answer
  • What is a benefit of the rise in citizen journalism? Multiple answer choice below
    13·1 answer
  • While using a web-based order form, an attacker enters an unusually large value in the Quantity field. The value he or she enter
    15·1 answer
  • _____ provides the best video resolution. *<br><br> VGA<br> HDMI<br> USB<br> DVI
    7·1 answer
  • An entity is said to be _____-dependent if it can exist in the database only when it is associated with another related entity o
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!