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
VARVARA [1.3K]
3 years ago
5

Given two integers low and high representing a range, return the sum of the integers in that range. For example, if low is 12 an

d high is 18, the returned values should be the sum of 12, 13, 14, 15, 16, 17, and 18, which is 105. If low is greater than high, return 0.
Examples:

sumRange(12, 18) -> 105

sumRange(1, 5) -> 15

sumRange(1, 100) -> 5050
Computers and Technology
1 answer:
Vaselesa [24]3 years ago
8 0

       System.out.println(sumRange(12, 18)); // prints 105

       System.out.println(sumRange(18, 12)); // prints 0

       System.out.println(sumRange(18, 18)); // prints 18

   }

   public static int sumRange(int low, int high)

   {

       int sum = 0;

       for (int val = low; val <= high; val++){

           sum += val;

       }

       return sum;

   }

}

You might be interested in
What does it mean to read visual and audio text
Ymorist [56]

To find meaning and decipher relationships between symbols and information


Talking books could be a means to automatize and generalize such an audio–visual reading experience. ... RWL consists of an experimental reading situation where one reads a text while one can hear it said aloud by a pre-recorded speaker or by a text-to-speech system.

8 0
4 years ago
In the early 1800's, a “computer" was not a machine, it was a person who did math
balu736 [363]

Answer:

True

brainly needs more words apparently

7 0
3 years ago
Read 2 more answers
When is it appropriate to utilize the nat network connection type?
lbvjy [14]
Whenever the VM does not need to be access at a known address by other network nodes.
6 0
3 years ago
What is the decimal equivalent of (11000 + 10000)/101?
Arturiano [62]

its answer in binary is 1000 and in decimal is 8.

7 0
3 years ago
_____ is a predefined format used for text the can include multiple font formatting features
seraphim [82]
The correct answer is



style
8 0
3 years ago
Other questions:
  • Jason is creating a webpage on the basic parts of a camera. He has to use a mix of both images and content for the web page to h
    11·1 answer
  • The most effective way to perform data entry is to keep your hands on the keyboard and press to move to the text cell in the row
    10·1 answer
  • Give a logical expression with variables p,q, and r that is true if p and q are false and r is true and is otherwise false.
    5·1 answer
  • ____ is another term for document properties.
    12·1 answer
  • Line spacing refers to the amount of space between each line in a paragraph. A. True B. False
    14·2 answers
  • What are interpersonal skills?
    12·2 answers
  • What does RFID use for wireless communication?<br> Infrared<br> IoT<br> Smart chip<br> Tag
    14·1 answer
  • What blockchain implementation resulted from bitcoin’s rejection of a recommendation to enhance its scripting language support?
    9·1 answer
  • Which of the following are acceptable to share? Check all of the boxes that apply.
    13·1 answer
  • Once you select a theme, you__________ change the theme’s individual elements independently of each other.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!