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
PilotLPTM [1.2K]
2 years ago
8

What is stored in alpha after the following code executes?

Computers and Technology
1 answer:
Andreas93 [3]2 years ago
6 0

Answer:

3. alpha = {1, 5, 6, 7, 5}

Explanation:

Initially, we have that:

alpha[0] = 1;

alpha[1] = 2;

alpha[2] = 3;

alpha[3] = 4;

alpha[4] = 5;

For j higher than 2, we have that:

alpha[j - 1] = alpha[j] + 2;

So

j = 3

a[2] = alpha[3]+2 = 4 + 2 = 6;

j = 4

a[3] = alpha[4]+2 = 5+2 = 7;

The correct answer is:

3. alpha = {1, 5, 6, 7, 5}

You might be interested in
A soft news story and a feature story are the same thing.<br> O True<br> O False<br> HELLPP ASSAAAP
bogdanovich [222]
The answer would be False!
5 0
2 years ago
Read 2 more answers
The Polish mathematician Wacław Sierpiński described the pattern in 1915, but it has appeared in Italian art since the 13th cent
soldi70 [24.7K]

Answer:

/ Sierpinski.java

public class Sierpinski {

     // method to find the height of an equilateral triangle with side length =

     // length

     public static double height(double length) {

           // formula= length*sqrt(3)/2

           double h = (length * Math.sqrt(3)) / 2.0;

           return h;

     }

     // method to draw a filled triangle (pointed downwards) with bottom vertex

     // x,y

     public static void filledTriangle(double x, double y, double length) {

           // finding height

           double h = height(length);

           // filling triangle as a polygon

           // passing x, x-length/2, x+length/2 as x coordinates

           // and y, y+h, y+h as y coordinates

           StdDraw.filledPolygon(new double[] { x, x - (length / 2.0),

                       x + (length / 2.0) }, new double[] { y, y + h, y + h });

     }

     // method to draw an n level sierpinski triangle

     public static void sierpinski(int n, double x, double y, double length) {

           // checking if n is above 0 (base condition)

           if (n > 0) {

                 // drawing a filled triangle with x, y as bottom coordinate, length

                 // as side length

                 filledTriangle(x, y, length);

                 // drawing the triangle(s) on the top

                 sierpinski(n - 1, x, y + height(length), length / 2);

                 // drawing the triangle(s) on the left side

                 sierpinski(n - 1, x - (length / 2.0), y, length / 2);

                 // drawing the triangle(s) on the right side

                 sierpinski(n - 1, x + (length / 2.0), y, length / 2);

           }

     }

     public static void main(String[] args) {

           // parsing first command line argument as integer, if you dont provide

           // the value while running the program, this program will cause

           // exception.

           int n = Integer.parseInt(args[0]);

           // length of the outline triangle

           double length = 1;

           // finding height

           double h = height(length);

           // drawing a triangle (pointed upwards) to represent the outline.

           StdDraw.polygon(new double[] { 0, length / 2, length }, new double[] {

                       0, h, 0 });

           // drawing n level sierpinski triangle(s) with length / 2, 0 as x,y

           // coordinates and length / 2 as initial side length

           sierpinski(n, length / 2, 0, length / 2);

     }

}

7 0
2 years ago
What time is it in Ohio?
skad [1K]
Geographically, the state of Ohio falls within the lines of latitude of 75 °W and 90 °W. The timezone corresponding to this portion of the globe is eastern standard time (EST). The prime meridian at 0 °, has the timezone greenwich mean time (GMT) from which all other timezones are referenced. And eastern standard time, local time in Ohio, will be 5 hours behind GMT.
5 0
3 years ago
Read 2 more answers
Does C supports STRINGS as a data type?
Nat2105 [25]

Answer:

C language does not support strings as a data type. A string is actually one-dimensional array of characters in C language. These are often used to create meaningful and readable programs.

Explanation:

6 0
1 year ago
Wich is the correct process for selecting an entire row in a spreadsheet?
umka21 [38]
CTRL - (select sentence) - ALT

4 0
2 years ago
Other questions:
  • Prompt the user for an automobile service. Each service type is composed of two strings. Output the user's input. (1 pt) Ex: Ent
    9·1 answer
  • If you specify a user without specifying a hostname, mysql will
    13·1 answer
  • Pamela finds that she is constantly spelling the word “color” as “colour” when she is typing. Even though this is how the word i
    11·1 answer
  • Which of the following is a popular open source intrusion detection system that runs on SmoothWall?? Synchronous Dynamic Random
    6·1 answer
  • Can anyone find any words in here?
    14·2 answers
  • What happens when you press the Enter key at the end of a line of bulleted text?
    14·2 answers
  • Select the correct answer from each drop-down menu. Look at Marta's email signature and fill in the missing elements. Marta D'Ab
    14·2 answers
  • A mobile application delivers market predictions based on stock data from the stock market data platform. Knowing that the data
    12·1 answer
  • When a user problem cannot be solved by the help desk at the first level of resolution, the problem is ___________ to the second
    7·1 answer
  • Database queries is an example of
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!