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
lapo4ka [179]
3 years ago
11

Write a java program that declares an array "alpha" of 50 elements of type "double". Initialize the array so that the first 25 e

lements are equal to the square of the index variable and the last 25 elements are equal to three times the index variable. Output the array so that 10 elements per line are printed
Computers and Technology
1 answer:
Mars2501 [29]3 years ago
5 0

Answer:

Here is code in java.

import java.util.*;

class Number

{   //main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

       // create an array of size 50 of double type

       double[] alpha = new double[50];

        //initialize array

       for(int x = 0; x< 50; x++)

               {

               if(x<25)

               {

                   alpha[x]= x * x;

               }

               else

               {

                   alpha[x]= 3 * x;

               }

            }

            //print 10 elements per line

            for(int y=1;y<=50;y++)

            {

                System.out.print(alpha[y-1] +" ");

                if(y%10==0)

                {

                    System.out.println();

                }

            }

   }catch(Exception ex){

       return;}

}

}

Explanation:

Create an array size 50 of double type.initialize first 25 elements as square

of the index variable and rest 25 as three times the index variable.Then print

the elements of array using for loop, if there is 10 elements in a line then

print a newline.

Output:

0.0 1.0 4.0 9.0 16.0 25.0 36.0 49.0 64.0 81.0

100.0 121.0 144.0 169.0 196.0 225.0 256.0 289.0 324.0 361.0

400.0 441.0 484.0 529.0 576.0 75.0 78.0 81.0 84.0 87.0

90.0 93.0 96.0 99.0 102.0 105.0 108.0 111.0 114.0 117.0

120.0 123.0 126.0 129.0 132.0 135.0 138.0 141.0 144.0 147.0

You might be interested in
What is typeface
Mademuasel [1]
I’m so bored and hungry answer is c 3566
4 0
3 years ago
Read 2 more answers
You are working with a database table that contains data about music. The table includes columns for track_id, track_name (name
german

The statement that completes the query is: bytes / 1000 AS kilobytes

<h3>SQL (Structured Query Language)</h3>

This is the language that is used to retrieve, update, and store data in the database.

<h3>Columns</h3>

From the question, we have the following table columns

  • track_id
  • track_name (name of the music track)
  • composer
  • bytes (digital storage size of the music track

To retrieve data from the bytes column, we make use of:

SELECT bytes ......

From the question, we understand that this column should be divided by 1000, and the AS command should be used.

So, the query becomes

SELECT bytes / 1000 AS kilobytes .....

Hence, the statement that completes the query is: bytes / 1000 AS kilobytes

Read more about database at:

brainly.com/question/24223730

5 0
2 years ago
What is another way to use the Help feature in Access 2016?
FinnZ [79.3K]

Answer:

I really don't know that 100% a question. But, Your answer will be C. Use the first command group under the Home tab to open a dialog box.​ Because, You got to use the first command group under screen computer. Then, You got use the click the help icon button that appears infront of the right interface. After that, If it shows a ok button press ok.

Um, Hope That Helps!!~

By Itsbrazts

4 0
3 years ago
Read 2 more answers
You want to search the web for information on the movie Captain America: Civil War. What would be the best way to enter the key
Digiron [165]

Answer:

Option C i.e., Captain America: Civil War.

Explanation:

When the user required the data or information of the movie Captain America: Civil War then, the following option is the best format to search for the information of the movie because if any user search anything in the proper format then they gets better results related to the following search and if the user enters improperly then they also get the information but it takes some time to satisfy you.

7 0
3 years ago
Analyzing computer systems to gather potential legal evidence is computer ________
hodyreva [135]
It is called computer forensics.
5 0
3 years ago
Other questions:
  • You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
    6·1 answer
  • Simplify (6x+6)+(-3-4x) please hurry!!!!!
    6·1 answer
  • ♡ Another Dum Question But Oh Wells -.- ♡
    12·2 answers
  • Consider having three String variables a, b, and c. The statement c = a + b; also can be achieved by saying_____________.a. c =
    11·1 answer
  • Hi, please help me.solution.​
    7·1 answer
  • Can someone help me with this error? Will give brainliest and i will give more details if you need just please help​
    11·1 answer
  • Debug the program so it prints the factorial of a positive integer entered by the user. This is calculated by multiplying all th
    9·1 answer
  • Sube
    10·2 answers
  • What does GEOSYNCHRONICE SATELLITE use for?​
    7·2 answers
  • If a pixel displayed on a screen has a red DN of 127, a green DN of 127, and a blue DN of 127, what color is the pixel
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!