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
harina [27]
3 years ago
7

Write a java program named SumThousand The program adds all the number from 1 to 1000 together and print out the sum

Computers and Technology
1 answer:
My name is Ann [436]3 years ago
6 0

Answer:

The program in Java is as follows:

public class SumThousand  {

   public static void main(String args[]) {

     int sum=0;

     for(int i =1;i<=1000;i++)

         sum+=i;

     

     System.out.println("Sum = " + sum);

   }

}

Explanation:

This initializes sum to 0

int sum=0;

This iterates from 1 to 1000

     for(int i =1;i<=1000;i++)

This calculates the required sum

         sum+=i;

     

This prints the calculated sum

     System.out.println("Sum = " + sum);

   

You might be interested in
White meat and dark meat fish have slightly different nutritional characteristics. What are the nutrition characteristics of dar
ipn [44]

The nutrition characteristics of eating darker meat of fish like Salmon are that it is higher in healthy Omega-3 fats. It is true, however, that as much as it has the highest Omega-3 fats, it is also likely to be highest in any potential toxins.






6 0
4 years ago
Read 2 more answers
Which network type uses a coaxial cable to receive its signal?.
Tresset [83]
If you’re asking what I think your saying I know comcast does
6 0
2 years ago
"how has user access of the web changed over the past 10 years? how does this impact the design of a website?"
FinnZ [79.3K]
Over the years, the internet has undergone major changes that has positively and negatively affected the overall interface, performance, and design of the entire website. Apart from this, it has completely changed the communities point of views towards technology and its appreciation of the market designs. Some of the major changes are based on its interface mostly on the screen size. In addition, all monitors being manufactured nowadays are calibrated. This means that, there is a better transition of images in-terms of image pixel.  
7 0
3 years ago
Who is the intended audience of a pseudocode document?
cluponka [151]

Answer and Example:

Pseudocode is an artificial and informal language that helps programmers develop algorithms.

Pseudocode is a "text-based" detail (algorithmic) design tool. The rules of Pseudocode are reasonably straightforward. All statements showing "dependency" are to be indented.

Pseudocode is understood by the programmers of all types. it enables the programmer to concentrate only on the algorithm part of the code development.

Java would use this.

3 0
3 years ago
Write biggerDigits.cpp that has a function called biggerDigits that uses two positive integer parameters with the same number of
fomenos

Answer:

Following are the program in the C++ Programming Language:

#include <iostream> //header file

using namespace std; //namespace

int biggerDigits(int n, int m) { //define function

if (n <= 0 || m <= 0) { //set if statement

return 0;  

}  

else { //set else statement

int a,b; //set integer variables

a = n % 10; //perform modulatio  

b = m % 10; //perform modulatio

int max = a; //set integer variable and assign value  

if (b > max) //set if statement

max = b; //initialize value to max

/*solution is here*/

return 10 * biggerDigits(n / 10, m / 10) + max;

}

}

int main() // main method  

{ // code is refer from question to make the program

cout << biggerDigits(567, 765) << endl; // call the function biggerdigits

cout << biggerDigits(123456, 444444) << endl; // call the function biggerdigits

//call function and print result

cout << biggerDigits(999, 111) << endl; // call the function biggerdigits

return 0; // return the integer 0

}

Explanation:

Here, we set the header file "<iostream>" and namespace "std" then, we set a function "biggerDigits()" and pass two integer type arguments inside it.

  • we set if condition in which when the variable "n" is less than equal to 0 or m is less than equal to 0 then, it return 0.
  • we set the else statement inside it we set two integer type variables "a" and "b" then, perform modulation with both the variables.
  • we set integer variable "max" and assign value of a in it.
  • we set if condition in which we check when the variable b is greater than variable max then, initialize the value of variable b in the variable max and return the solution through recursion.
7 0
3 years ago
Other questions:
  • In the ADT graph, the method addEdge has efficiency
    6·1 answer
  • Which devices are managed through device management?
    5·1 answer
  • An administrator wants to configure hosts to automatically assign IPv6 addresses to themselves by the use of Router Advertisemen
    14·1 answer
  • Create an array using the makeRandomArray method, then take a start time using System.currentTimeMillis(). Next, run the array t
    13·1 answer
  • CAN SOMEONE PLEASE HELP ME WITH THIS PLEASE ?!!!!!!!!
    14·1 answer
  • 2 4. What is one way to prepare for building a project budget? (1 point)​
    9·1 answer
  • Accenture has put together a coalition of several ecosystem partners to implement the principles of blockchain and Multi-party S
    5·1 answer
  • Pls help me Pls help me
    13·1 answer
  • Why does virtual reality rely on slightly different views for each eye?
    6·1 answer
  • Application for a lawn-mowing service. The lawn-mowing season lasts 20 weeks. The weekly fee for mowing a lot under 40 square fe
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!