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
photoshop1234 [79]
3 years ago
5

Write a short java method that takes an integer n and returns the sum of all the odd positive integers less than or equal to n.

Computers and Technology
1 answer:
umka2103 [35]3 years ago
3 0
Public int add2n( int n )
{
    int total;
    if( n % 2 == 0 )
        total = n--;

    while( n > 0 )
    {
        total += n;
        n -= 2;
   }
   return( total );
}

You might be interested in
What is the name of the popular DBMS (database management system) that is open source and is distributed under the General Publi
Alex_Xolod [135]

Answer:

I looked it up on google and it said that one of the most popular ones is MySQL.

Explanation:

I don't know if it's right. I just looked it up on google.

6 0
3 years ago
Which of the following best describes a hacktivist? Select one: a. An individual who attempts to destroy the infrastructure comp
brilliants [131]

Answer: (B) An individual who hacks computers or Web sites in an attempt to promote a political ideology

Explanation:

 Hacktivist is the defined as an individual that basically hacks the various types of web sites and computer system for promoting the various political ideologies. The hacktivists is the method which include the DDOS attacks (Distributed denial of services).

It basically causes various website and the email with the congestion of traffic with the computer virus and by the data stealing. The denial of services attacks typically considered federal crime and illegal in united state.  

4 0
4 years ago
In the game of economics, producers look to technological improvements to increase which of the following?
Vaselesa [24]
They're looking to increase productivity 
7 0
3 years ago
Read 2 more answers
What is the process called when programmers look for and fix errors in code?
AveGali [126]

Answer:

d

Explanation:

7 0
3 years ago
Read 2 more answers
Why am i doing the investigation​
juin [17]
Because it’s your interest
6 0
3 years ago
Other questions:
  • Given a string variable named sentence that has been initialized , write an expression whose value is the the very last characte
    14·1 answer
  • In Word, how can you tell when text is selected?
    8·1 answer
  • What are the Typical application<br>of mini computer​
    5·2 answers
  • Convert the ProjectedRaises class to an interactive application named ProjectedRaisesInteractive. Instead of assigning values to
    15·1 answer
  • I will give brainiest to the person that is right. What is change management?
    9·1 answer
  • USB 3.1 offers an improvement over its predecessors by enabling a maximum data transfer rate of up to:
    8·1 answer
  • Programs for embedded devices are often written in assembly language. Some embedded processors have limited instructions, like M
    5·1 answer
  • Which of the following commands appears in the INSERT menu or tab?
    10·1 answer
  • Which statement best describes network security?
    7·1 answer
  • Beth is a software developer who is focused on identifying early-stage interface problems. Beth addresses the dimension of usabi
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!