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
Alenkasestr [34]
3 years ago
6

Which pattern is produced by the following code? for (int i = 1; i <= 6; i++) { for (int j = 6; j >= 1; j--) System.out.pr

int(j <= i ? j + " " : " " + " "); System.out.println(); } Pattern A Pattern B Pattern C Pattern D 1 1 2 3 4 5 6 1 1 2 3 4 5 6 1 2 1 2 3 4 5 2 1 1 2 3 4 5 1 2 3 1 2 3 4 3 2 1 1 2 3 4 1 2 3 4 1 2 3 4 3 2 1 1 2 3 1 2 3 4 5 1 2 5 4 3 2 1 1 2 1 2 3 4 5 6 1 6 5 4 3 2 1 1
A. Pattern A
B. Pattern B
C. Pattern C
D. Pattern D
Computers and Technology
1 answer:
Brrunno [24]3 years ago
3 0

Answer:

              1                                                                                                                    

           2 1                                                                                                                    

        3 2 1                                                                                                                    

     4 3 2 1                                                                                                                    

  5 4 3 2 1                                                                                                                    

6 5 4 3 2 1

Explanation:

I do not now know which option it corresponds but the shape should look like above.

The logic is following;

There is a nested for loop. The inner loop prints the value of j, when j is smaller than or equal to i. Otherwise, it prints a space.

For example, in the first iteration i = 1 and j starts from 6.

i = 1, j = 6 -> print space

i = 1, j = 5 -> print space

i = 1, j = 4 -> print space

i = 1, j = 3 -> print space

i = 1, j = 2 -> print space

<u>i = 1, j = 1 -> print j</u>

You might be interested in
An example of cooler red is
BARSIC [14]

apple, stop sign, fire truck, stop light... ect

6 0
3 years ago
Which of the following is the 1's complement of 10?
OverLord2011 [107]
Flip 10 and you get 01 then you add 1 to it:
1
01
+ 1
-----
1 1

So, C. 11
6 0
3 years ago
Read 2 more answers
What is the critical path?
Natali [406]

Answer:

Option C. The path from start to finish that passes through all the tasks that are critical to completing the project in the shortest amount of time

is the correct answer.

Explanation:

  • Critical path is the term used in Project management.
  • It can be known by determining the longest stretch for dependent activities and the time required for them to complete.
  • A method known as "critical path method" is used for Project modelling.
  • All types of projects including aerospace, software projects, engineering or plant maintenance need Critical method analysis for the modeling of project and estimation.

I hope it will help you!

3 0
3 years ago
Read the following examples, and decide whether each example describes a relational database or a flat
bezimeni [28]

Answer: flat file, relational database, relational database, relational database

Explanation:

Edge

7 0
3 years ago
Read 2 more answers
Rock, Paper, Scissors
telo118 [61]

import random

computer_choice = random.choice(['rock', 'paper', 'scissors'])

player_choice = input('Choose rock, paper, or scissors: ')

if player_choice == computer_choice:

   print('Tie. Both players chose '+player_choice)

elif (player_choice == 'rock' and computer_choice == 'scissors') or (player_choice == 'paper' and computer_choice == 'rock') or (player_choice == 'scissors' and computer_choice == 'paper'):

   print('You won! '+player_choice +' beats '+computer_choice)

else:

   print('You lost! '+computer_choice+' beats '+player_choice)

I wrote my code in python 3.8. I hope this helps. Note the elif statement is actually one line of code but it looks like it takes up more than one line.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Identify one type of business or organization that you believe would have serious risks if they chose to use VLANs and/or VPNs.
    5·1 answer
  • Lynn runs the locate command and the results include many files from a directory that she doesn't want to include in her search.
    9·1 answer
  • What does phishing mean?
    9·2 answers
  • How do you represent (decimal) integer 50 in binary
    7·1 answer
  • The Internet is not a good place to connect with people when looking for a job.
    10·1 answer
  • What does aux stand for on a car remote?
    13·2 answers
  • You have a computer at home. The computer is connected to the Internet through a dial-up connection. Every time you connect to t
    14·1 answer
  • Ethan is afraid that his poor grades will get him kicked out of his university at the end of the semester. He decided to remotel
    10·1 answer
  • can anyone yell how to save the python file in folder i am saving it but whenever I'm trying to open its not open​
    15·2 answers
  • Why do we need to use a VPN service?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!