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
What are five most important areas of the animal industry that involve science and technology?
BigorU [14]

Animal Health, Breeding, Meat Sanitation/Preservation, Feeding, Waste Disposal

3 0
3 years ago
Interpretations of the AICPA Code of Professional Conduct are dominated by the concept of: Question 4 options: 1) independence.
timama [110]

Answer: independence

Explanation:

The AICPA Code of professional Conduct is based on the following concepts which are :

1. responsibilities

2. serve the public interest

3. integrity

4. objectivity and independence

5. due care

6. The scope and nature of services.

3 0
2 years ago
What is a column in a table
serious [3.7K]

Answer: The columns in a table are the set of facts that we keep track of about that type of object.

Explanation:

5 0
3 years ago
Read 2 more answers
List four reasons of meaningful use that demonstrate the capabilities and processes required for the provider to show active use
Naily [24]

<span>1.       </span>Improve quality of care and reduce health disparities.

<span>2.       </span>Read the orders in the medical record and make sure to read it back again to verify accuracy.

<span>3.       </span>Maintain the security and privacy of patient health information.

<span>4.       </span>Talk to the patients and families in management of their health care.






7 0
3 years ago
Compare Fibonacci (recursion vs. bottom up)
ipn [44]

Answer:

C++ code explained below

Explanation:

#include<bits/stdc++.h>

#include <iostream>

using namespace std;

int FiboNR(int n)

{

int max=n+1;

int F[max];

F[0]=0;F[1]=1;

for(int i=2;i<=n;i++)

{

F[i]=F[i-1]+F[i-2];

}

return (F[n]);

}

int FiboR(int n)

{

if(n==0||n==1)

return n;

else

return (FiboR(n-1)+FiboR(n-2));

}

int main()

{

long long int i,f;

double t1,t2;

int n[]={1,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75};

cout<<"Fibonacci time analysis ( recursive vs. non-recursive "<<endl;

cout<<"Integer FiboR(seconds) FiboNR(seconds) Fibo-value"<<endl;

for(i=0;i<16;i++)

{

clock_t begin = clock();

f=FiboR(n[i]);

clock_t end = clock();

t1=double(end-begin); // elapsed time in milli secons

begin = clock();

f=FiboNR(n[i]);

end = clock();

t2=double(end-begin);

cout<<n[i]<<" "<<t1*1.0/CLOCKS_PER_SEC <<" "<<t2*1.0/CLOCKS_PER_SEC <<" "<<f<<endl; //elapsed time in seconds

}

return 0;

}

7 0
2 years ago
Other questions:
  • This is the main work area of your computer.
    7·1 answer
  • Which of these statements best describes an application programming interface?
    5·1 answer
  • What is wrong with my code?
    7·1 answer
  • If your internet were to go out, what steps would you take to troubleshoot to restore your service?
    15·1 answer
  • 2.13 LAB: Branches: Leap Year
    11·1 answer
  • I WILL GIVS BRAINLIEST IF U ANSWER THIS
    9·1 answer
  • How it/computing has impacted on engineering? <br><br> I need seven answers please help !
    11·1 answer
  • Providing captions and transcripts for videos on your website is a way of ensuring what?.
    7·1 answer
  • assuming the default gateway is connected to the internet, what type of internet access would this server have?
    14·1 answer
  • A web site that contains large numbers of misspelled words and grammatical errors fails which of these general criteria?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!