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
garri49 [273]
3 years ago
12

You do not need to use any functions beyond the main function in this problem. Initialize an array of int with the values: 4, 6,

9, and 12. Write a for loop to add the values in the array and find their sum. Write a second loop to print the values from the array and their sum in the following format: 4 6 9 12
Computers and Technology
1 answer:
zheka24 [161]3 years ago
4 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    int[] arr = {4, 6, 9, 12};

    int sum = 0;

   

    for(int i=0; i<arr.length; i++){

        sum += arr[i];

    }

   

    for(int i=0; i<arr.length; i++){

        System.out.print(arr[i] + " ");

    }

    System.out.println("");

 System.out.println("The sum of the numbers: " + sum);

}

}

Explanation:

* The code is written in Java.

- Initialize the array with the given numbers

- Initialize the <em>sum</em> variable as zero

- Calculate the sum in the first for loop

- Print the numbers in the second for loop

- Print the <em>sum</em>

You might be interested in
It is desirable to provide a degree of __________ __________ among classes so that one class is not adversely affected by anothe
alexandr402 [8]

Answer:

The right approach is "Traffic isolation ".

Explanation:

  • A significant amount of those same traffic insulation is necessary. Therefore one class isn't influenced by yet another traffic class which makes a mistake. Then maybe the packages throughout the traffic could collapse.
  • This also eliminates uncertainty with people operating the infrastructure. If you don't need the VLANs to speak to one another because you could implement anything about this illustration as well as add it to certain VLANs.
4 0
3 years ago
A folder has been shared with other users and set to read-only. What does this mean for users?
skelet666 [1.2K]

Answer:

it means they can not make edits or changes to said folder

Explanation:

8 0
3 years ago
Read 2 more answers
It is possible to turn extrinsic factors into intrinsic motivators. true or false
anygoal [31]
Definitely true. People who, for example, grew up homeless can use that as motivation to work harder in life.
8 0
3 years ago
Read 2 more answers
Write three tasks students can preform in a digital classroom?
Nadya [2.5K]

Students can perform several tasks in a digital environment. For example, they can watch instructional videos, take notes, and participate in peer discussions.

this is the right answer .just did it

7 0
3 years ago
Read 2 more answers
Jiz<br>Active<br>2<br>3<br>- 2(7 - 15)<br>What is the value of<br>4​
-Dominant- [34]

Answer: I think it is c

Explanation: hope this helps

3 0
3 years ago
Read 2 more answers
Other questions:
  • What does the security element of non-repudiation mean in e-commerce cybersecurity? A. Data needs to be available at all times.
    10·1 answer
  • The part of the inside of a computer
    14·1 answer
  • Write a C or C program A6p2.c(pp) that accepts one command line argument which is an integer n between 2 and 4 inclusive. Genera
    9·1 answer
  • If I make a Zoom Meeting, would you join it?
    7·2 answers
  • Which is an example of a tertiary source?
    13·1 answer
  • What type of html list will automatically place a number in front of the items?
    9·1 answer
  • if you play creative destruction and if u have a mic and if u play it 24/7 and would like to form a team tell me your name or yo
    7·1 answer
  • Explain with examples what is software​
    6·1 answer
  • Deirdre has a hearing disability. One of her friends advised her to use real-time text or RTT on her phone. In which of these
    13·1 answer
  • Write the text of the program in Python.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!