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
FinnZ [79.3K]
3 years ago
5

Program to calculate series 10+9+8+...+n" in java with output

Computers and Technology
1 answer:
avanturin [10]3 years ago
5 0

Answer:

import java.util.Scanner;

class Main {

 public static int calcSeries(int n) {

   int sum = 0;

   for(int i=10; i>=n; i--) {

     sum += i;

   }

   return sum;

 }

 public static void main(String[] args) {

   Scanner reader = new Scanner(System.in);

   int n = 0;

   do {

     System.out.print("Enter n: ");

     n = reader.nextInt();

     if (n >= 10) {

       System.out.println("Please enter a value lower than 10.");

     }

   } while (n >= 10);

   reader.close();

   System.out.printf("sum: %d\n", calcSeries(n));

 }

}

You might be interested in
Jason Chang is creating photos of his restaurant for a new website. Some of the photos of the staff have red eye, others are bad
Nadusha1986 [10]

It is okay to modify photos digitally to improve their appearance as long as it doesn't show what they aren't producing.

<h3>What is Advertisement?</h3>

This is the act of persuading people to buy goods and services and is usually done with the aid of the media.

Pictures are usually taken which have to be in the best shape and quality in order to entice people to buy the goods thereby bringing about higher sales and profit for the company.

Read more about Advertisement here brainly.com/question/1020696

7 0
2 years ago
14. The Internet may best be compared to a/an
finlep [7]
From that particular list, the item that best compares to the internet
is B. a large network of roads.
7 0
3 years ago
Read 2 more answers
Image editors edit images consisting of thousands of pixels that form this type of image.
lapo4ka [179]
Hi! Did you forget to add something to this?
6 0
3 years ago
Read 2 more answers
What is computer hacking? describe some examples
Naily [24]
Computer hacking<span> refers to the practice of modifying or altering </span>computer<span> software and hardware to accomplish a goal that is considered to be outside of the creator's original objective.
</span>
“bot,” is a computer under the control of a hacker <span>without the knowledge of the computer user.</span>

3 0
3 years ago
NEED HELP ASAP! BRAINLIEST AND 20 PTS TO CORRECT ANSWER!
son4ous [18]

The correct answer is C.

8 0
3 years ago
Other questions:
  • Saas provides services to an organization that requires the standard business process infrastructure such a CRM
    7·1 answer
  • If you had to choose, would you consider yourself more of an internet celebrant or a skeptic? On balance, do you think the inter
    10·1 answer
  • Why are application programs stored in main memory​
    11·1 answer
  • Pda bkhhksejc pnwjoynelp dwo xaaj ajykzaz ywj ukq zaykza ep???<br><br><br> The Key Value is 22
    12·1 answer
  • You're setting up some VMs to test an application you're considering making available to employees of the small company you work
    11·1 answer
  • In the language of the World Wide Web, "this page cannot be displayed" means A. your computer's software is damaged. B. the ISP
    10·2 answers
  • Which statement about intellectual property is true? (CSI-7.6) Group of answer choices It is okay to use code you find on the in
    14·1 answer
  • True or False? Popular sites are always mean accurate.
    14·2 answers
  • WHATS 5X750 i really dont even know that questiob
    7·2 answers
  • What type of task can be defined to allow you fine-grained control over the management tasks a user can perform in an OU
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!