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
dolphi86 [110]
3 years ago
13

Assume that the int variables i and j have been declared, and that n has been declared and initialized. using for loops (you may

need more than one), write code that will cause a triangle of asterisks of size n to be output to the screen.
Computers and Technology
1 answer:
olga_2 [115]3 years ago
3 0
You should really state what language you're using. Here it is easily produced in C#, and shouldn't be too much of a hassle to translate to other languages. Note that I did not need to use the iterative variable ( j ), and could instead just use ( i ) in one for loop.

Console.Write("Enter size of triangle: ");           
int n = Convert.ToInt32(Console.ReadLine());         
for (int i = n - 1; i >= 0; i--)               
    Console.WriteLine(new String('*', n - i));
You might be interested in
A ______ statement selects for execution a statement list having an associated label that corresponds to the value of an express
bogdanovich [222]

Answer:

A) Switch

Explanation:

In Java and most programming Languages, A Switch Statement provides a multi branch statements which provides a more flexible way for transfer of execution to the branch that fulfills the condition of the expressed value. This is a better way of handling if...elseif....else statements. In this way, a variable is tested for equality against some values. Variables used in switch expressions can only be primitives (int, byte, char), enums and strings.  A switch statement has

1. A default statement (optional), appears at the end of the switch and acts as the else condition.

2. A break statement which terminates the switch when reached.

The syntax of a switch statement is given below:

switch(expression) {

 case x:

   // code block

   break;

 case y:

   // code block

   break;

 default:

   // code block

}

6 0
3 years ago
Write a program to sort the (name, age, score) tuples by descending order where name is string, age and score are numbers. The s
zimovet [89]

Answer:

The program in Python is as follows:

from operator import itemgetter

m = int(input("Number of records: "))

print("Name, Age, Score")

my_list =[]

for i in range(m):

   user_details = input()

   my_list.append(tuple((user_details.split(","))))

my_list.sort(key =  itemgetter(0, 1, 2))        

print("Sorted: ", my_list)

Explanation:

This imports the operator function from itemgetter

from operator import itemgetter

This gets the number of records, m

m = int(input("Number of records: "))

This prints the format of input

print("Name, Age, Score")

This initializes the list of tuples

my_list =[]

This iterates through m

for i in range(m):

This gets the details of each person

   user_details = input()

This appends the details to the tuple

   my_list.append(tuple((user_details.split(","))))

This sorts the tuple

my_list.sort(key =  itemgetter(0, 1, 2))        

This prints the sorted tuple

print("Sorted: ", my_list)

6 0
2 years ago
What is a new ransomware program that encrypts your personal files and demands payment for the files' decryption keys? Multiple
frosja888 [35]

Answer: Simple-locker

Explanation:Simple-locker is the program that works on the technique in which it automatically encrypts the data or files and then demand a certain ransom or money from the user for the decryption of that data. It works on the function to gain the ransom or incentive in the financial form.

The decryption can only be carried out in safe way when the victim has the key to decrypted data or file.

5 0
3 years ago
What are the features of G-mail <br><br>(Write in your own words)​
wlad13 [49]

Answer:

here is what I think!

Explanation:

G-mail is:

  1. secure
  2. easy to use
  3. fast
  4. can be used to sign in anywhere!<u>(including brainly)</u>
  5. you don't need to pay when creating one
  6. can help you in billing and buying apps and their paid product
  7. <em><u>you </u></em> can use it because <em>why no!</em>
  8. some websites need G-mail to be used

thats why you should use G-mail

tell me if you have an idea!

3 0
3 years ago
Read 2 more answers
Felicia's Wi-Fi connection to her phone is extremely slow. However, her
Alex Ar [27]

Answer: fake water all across the road

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Does anyone watch The Office?
    14·1 answer
  • What is the rationale behind the development of an operating system in computing?
    15·1 answer
  • What are the benefits of using a multiview sketch?
    11·1 answer
  • In DTP, a good rule of thumb is to use as many special effects as you need to make your documents look interesting.
    5·1 answer
  • A contracting company recently completed it's period of performance on a government contract and would like to destroy all infor
    13·1 answer
  • what you can do to increase your chances of getting employed with changes to your current digital footprint​
    6·1 answer
  • How did punch cards improve the weaving process?
    11·1 answer
  • The nl2br() function can be used to convert new line entries in a text area into html ________________ tags.
    13·1 answer
  • Will mark Brainliest!! What is the best memory to use on a computer? Why?
    9·1 answer
  • Kinda strange, and im good
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!