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
A semiconductor kit is used on a
iragen [17]

The correct answer is PSC motor.

If you need more help, you can check on quizlet, I learnt about ecd from there lol

5 0
3 years ago
For a class Foo, one difference between a variable declared Foo * and a variable declared Foo &amp; is that only the variable de
Studentka2010 [4]

Answer:

False.

Explanation:

When we declare a variable as reference type we have to initialize that variable otherwise the compiler will give error that the reference variable is not initialized.You also cannot initialize the variable Foo& with NULL value because it is a reference variable and we have to initialize it.

On the other there is no need to initialize the variable Foo * since it is a pointer it can also store NULL value.

So the answer is only Foo* can store NULL value not Foo &.

5 0
3 years ago
Smaller applications, such as at home, typically use a powerful, expensive server to support their daily operations.
snow_tiger [21]
False.
Smaller applications such as at home, sometimes use a high-end desktop as a server. Larger corporate, government, and internet applications use powerful, expensive servers to support daily operations.
hope this helps!
3 0
2 years ago
What is one way that Accenture helps clients ensure fairness when applying AI solutions?
telo118 [61]

Answer: Accenture is developing a tool to help businesses detect gender, racial and ethnic bias in artificial intelligence software. 5 It lets users define the data fields they consider sensitive—such as race, gender or age—and then see the extent to which these factors are correlated with other data fields.

Explanation:

5 0
3 years ago
One way to align and organize your table of contents is by using _______, which are dotted lines that precede your typed informa
bekas [8.4K]
They are dot leaders......
8 0
3 years ago
Other questions:
  • Impact of computer on education
    6·2 answers
  • What are some useful properties of current electricity
    13·2 answers
  • A(n) ________ converts your voice's sound waves into digital signals.
    9·1 answer
  • Advantages of heading attributes
    5·1 answer
  • list the six external parts or "peripherals" of a computer system and identify which are output and which are input devices.
    15·1 answer
  • The mobile nodes (devices) add or leave a Mobile Ad-hoc Network, changing the _____ of this network over time. a) infrastructure
    14·1 answer
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    14·1 answer
  • Having data in a column formatted differently based on value is known as
    7·1 answer
  • 7. Question
    12·1 answer
  • 1. What are you going to do if someone ask for your personal information online?​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!