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
A powerpoint ________ is a set of unified design elements.
natka813 [3]
<span>Within the elements of design, the set of elements of unified designs among them is called corporate because they create unity of identities of elements forming a set of equality of profiles and identities. Corporate is associated and collective to form equal elements and create a unit in the design.</span>
7 0
3 years ago
Which types of scenarios would the NETWORKDAYS function help calculate? Check all that apply.
inna [77]

Answer:

A. days of vacation time left

B. days of school left in the year

D. years of service someone performed

Explanation:

The NETWORKDAYS function is a built in excel function which makes it easy to calculate the number of days between two specified dates the start date and the end date, this function when applied excludes weekends from the days calculated and one has the opportunity of specifying certain holidays. With this function. The number of days till vacation, the number school days left. The NETWORKDAYS is a very versatile function.

7 0
3 years ago
Which type of graph or chart will you use to show changes in data points?
likoan [24]
You would use a line graph because, line graphs show you the slope. The slope represents a change in data.
6 0
3 years ago
Is there such thing as free will
dybincka [34]

Answer:

Yes there is but it's rare cause everywhere we go we're tied down from some rules cause they help society function better

7 0
3 years ago
Read 2 more answers
Describe at least one issue of terrorism that has happened recently.
zvonat [6]

Answer:

The republicans storming the capitol

Explanation:

6 0
2 years ago
Other questions:
  • Use the script below as a starting point to create a Rectangle class. Your rectangle class must have the following methods;A con
    12·1 answer
  • What are some situations where you might find it useful to use the “!” symbol in a program?
    9·1 answer
  • All of the following activities may infect your computer with a virus EXCEPT ________.
    6·1 answer
  • Dimensional arrays can be created using loops. 2 dimensional arrays can be created using:
    10·1 answer
  • The intellectual property right that gives a creator control of his or her written work is known as what?
    9·1 answer
  • Which of the following technologies is an example of social media
    12·1 answer
  • What can be done to solve unemployment problem?​
    11·1 answer
  • State the Limitations of the first generation of computers​
    8·1 answer
  • Imagine that you need to prepare for three end-of-term tests. What steps will you take to make sure your study time is well spen
    5·1 answer
  • Noah is creating a startup. He uses the website Upwork to hire freelancers in India and in the Ukraine to work for him. This is
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!