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
oee [108]
4 years ago
13

Write the definition of a method named add that receives a reference to a Scanner object associated with a stream of input consi

sting of integers only. The method reads all the integers remaining to be read from the stream and returns their sum. So if the input were 3 51 204 17 1040 the returned value would be 1315
The method must not use a loop of any kind (for, while, do-while) to accomplish its job.
Computers and Technology
1 answer:
Lisa [10]4 years ago
5 0

Answer:

import java.util.*;

class Main  

{

   public static void main(String[] args)

   {

       System.out.println("Enter integers and 0 to exit");

       Scanner a1=new Scanner(System.in);

       System.out.println(add(a1));

       

   }

  public static int add(Scanner a1)

  {

        int total = a1.nextInt();

          if (a1.hasNextInt())

              {

                 total =total +add(a1);

              }

       return total;

   }

}

Explanation:

The only thing that needs explanation here is hasnextInt. This returns true if entered number is integer and false if entered is not an integer. And rest is as shown in the program.

You might be interested in
Where should your two index fingers be when your fingers are rest.
PSYCHO15rus [73]

Answer: B : F and J

Explanation: Allows you to type without looking at keys and makes all the keys easily accessible

5 0
3 years ago
I've been stuck on these two basic javascript assignments for an embarrassingly long time. The teacher refuses to help me and th
user100 [1]

Answer:

it is 29 0ver 30

Explanation:

i took the quiz

5 0
3 years ago
What do you think is the reason why there are two kinds of transmission mode in computer networking?
saul85 [17]

Answer:  Transmission mode or communication mode is referred to as transmission of data between two devices using a communication channel that includes an optical fiber, copper wires, wireless channels, and various storage media. The data that gets transmitted is in the form of electromagnetic waves. There are various ways of data transmission where the message that is passed is in the sequence of pulses using digital modulation. The transmission mode of data was first introduced in a computer networking system during the 1940s in modems, then in LANs, WANs, repeaters, and other networking system

is this what u are looking for?

7 0
2 years ago
What is output by the following code?
Inessa05 [86]
When numbers are divided, the integer portion is kept and the remainder is disregarded (meaning 10/9 would return 1). Following this format, we get the answer of <span>6 6 6 3 7 7 9 5 8 8. 
I also see that this program can be optimized because you use the same for loop twice, and both of them manipulate list elements in some way. A more optimized program would be:

</span><span>int a [] = {64 , 66 , 67 , 37 , 73 , 70 , 95 , 52 , 81 , 82};

for (int i = 0; i < a.length; i++) {
  a[i] = a[i] / 10;
  </span>System.out.print(a[i] + " ");<span>
}

Or maybe you don't need to store the list values for later on. You could do:

</span>for (int i = 0; i < a.length; i++) {
  System.out.print(a[i] / 10 + " ");
}

In any situation, your answer is choice 2.
8 0
3 years ago
How do database systems turn data into information?
Simora [160]

Answer:

1. Collect only useful data

Before collecting data, take a step back and ask the fundamental question: Can I turn this data into information or knowledge to help me make decisions that will improve services and reduce costs? When you understand the answer to that question, you will be in a better position to establish what data to collect and how to turn it into information you need to make decisions.

2. Use analytical tools

Use tools that help you analyze the information and data you have. Export the data from your system if necessary and load it into Excel. Use Excel’s pivot table tool to analyze data and convert it into information. You can use other software or enterprise systems that are designed for data analysis as well. The key thing is to step beyond lists and printouts and start analyzing the data in a way that’s meaningful to your responsibilities.

3. Get accurate data

Of course, you need good data in the first place. Make sure you have what you need and it is reasonably accurate, but consider how you will use it and how much of a difference accurate data will make in your decision-making.

Accuracy or detail are also something you need to manage so you don’t end up overwhelmed with detail, or spend too much effort getting detail or accuracy that simply doesn’t matter in the end. For instance, if you are tracking costs as part of a process in order to make management decisions, does your tracking method have to tie into the financial system and match to the penny? Does it have to be a live link with your own system, or can you download the needed information from the financial system daily or weekly?

4. Convert data to information

Information is when you take the data you have and analyze it or manipulate it by combining it with other data, trending it over time, assessing or analyzing the outliers that need to be dealt with, and, most important, applying your own experience and knowledge to transform that data into something you can use to make a decision with.

4 0
3 years ago
Other questions:
  • In order to be compliant with the NIST publications, policies must include key security control requirements. One of these key r
    10·1 answer
  • Forensic scientists generally photograph and sketch a computer and its components during their analysis? True or false
    12·2 answers
  • One of the most toxic components of a computer is the
    11·1 answer
  • Which of the following tends to be true of silent film acting as opposed to sound film acting?
    7·1 answer
  • Create a view named product_summary. This view should return summary information about each product. Each row should include pro
    13·1 answer
  • What is earning potential?
    10·1 answer
  • What provision of the Government Paperwork Elimination Act was designed to encourage a paperless society?
    6·2 answers
  • Jeffery wants to identify the subject terms being used in APA PsychInfo for articles related to behavior modifications. What is
    9·1 answer
  • Write a sed command that will display all lines of the birthday file that do not contain the string March. What was the sed comm
    13·1 answer
  • Explain the use of mail merge feature. <br>pls help​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!