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
Karo-lina-s [1.5K]
3 years ago
6

(1) The given program outputs a fixed-height triangle using a * character. Modify the given program to output a right triangle t

hat instead uses the user-specified triangle_char character. (1 pt) (2) Modify the program to use a loop to output a right triangle of height triangle_height. The first line will have one user-specified character, such as % or *. Each subsequent line will have one additional user-specified character until the number in the triangle's base reaches triangle_height. Output a space after each user-specified character, including a line's last user-specified character. (2 pts) Example output for triangle_char = % and triangle_height = 5:

Computers and Technology
1 answer:
zloy xaker [14]3 years ago
6 0

Answer:

Following are the code to this question can be described as follows:

c= input('Input triangle_char: ') #defining variable c that input character value  

length = int(input('Enter triangle_height: ')) # Enter total height of triangle

for i in range(length): # loop for column values

   for j in range(i+1): #loop to print row values

       print(c,end=' ') #print value  

   print()# for new line

Output:

please find the attachment.

Explanation:

In the above python code, two variable "c and length" variables are declared, in variable c is used to input char variable value, in the next line, length variable is defined, that accepts total height from the user.

  • In the next line, two for loop is declared, it uses as nested looping, in which the outer loop prints column values and inner the loop is used to prints rows.
  • To prints all the value the print method is used, which prints the user input character triangle.

You might be interested in
The ____ algorithm was the first public key encryption algorithm developed (in 1977 and published for commercial use.
Whitepunk [10]
The RSA Algorithm was developed by and named after the initials of: Ron Rivist, Adi Shamir, and Leonard Adleman while they were working at MIT. It was developed in 1977 and published in 1978.  The algorithm uses the exponentiation modulo in encrypt and decrypt information. 
7 0
3 years ago
What is the difference between posting and transfer in ICT please I need the answer before TMR​
Radda [10]

Answer: b

Explanation: trust

7 0
2 years ago
True or false? a router is a network device that directs packets over a network towards their final destination.
Alex_Xolod [135]

A router is a web device that directs packages over a web towards their final destination is true.

<h3>What is the router?</h3>
  • A router is a machine that combines two or more packet-switched grids or subnetworks.
  • A router accepts and data transmits  on computer networks. Routers are sometimes confused with network hubs, modems, or network controllers.
  • However, routers can integrate the functions of these components, and secure with these devices, to improve Internet entry or help create interaction networks.
  • A router is a device that is used for forwarding the internet connection to all the related devices.
  • A Wi-Fi connects the networking parts of a router and a wireless access point.
  • A wireless router (or Wi-Fi router) works much like a wired router, but it returns wires with wireless radio calls.

To learn more about router, refer to:

brainly.com/question/24812743

#SPJ4

7 0
1 year ago
Create a flowchart that assigns a counselor to a student.
Nataly [62]
Please Help! Unit 6: Lesson 1 - Coding Activity 2
Instructions: Hemachandra numbers (more commonly known as Fibonacci numbers) are found by starting with two numbers then finding the next number by adding the previous two numbers together. The most common starting numbers are 0 and 1 giving the numbers 0, 1, 1, 2, 3, 5...
The main method from this class contains code which is intended to fill an array of length 10 with these Hemachandra numbers, then print the value of the number in the array at the index entered by the user. For example if the user inputs 3 then the program should output 2, while if the user inputs 6 then the program should output 8. Debug this code so it works as intended.

The Code Given:

import java.util.Scanner;

public class U6_L1_Activity_Two{
public static void main(String[] args){
int[h] = new int[10];
0 = h[0];
1 = h[1];
h[2] = h[0] + h[1];
h[3] = h[1] + h[2];
h[4] = h[2] + h[3];
h[5] = h[3] + h[4];
h[6] = h[4] + h[5];
h[7] = h[5] + h[6];
h[8] = h[6] + h[7]
h[9] = h[7] + h[8];
h[10] = h[8] + h[9];
Scanner scan = new Scanner(System.in);
int i = scan.nextInt();
if (i >= 0 && i < 10)
System.out.println(h(i));
}
}
4 0
2 years ago
Read 2 more answers
Maria's manager asked her to print a certain document for their meeting. It took her so long to find the file that she was late
Hoochie [10]

hey let me and sans help. . . . .hmmm. . .

sans said create a word-processing document that lists where she has saved files.

9 0
3 years ago
Read 2 more answers
Other questions:
  • In mathematics, the factorial of a positive integer n, denoted as n! , is the product of all positive integers less than or equa
    10·2 answers
  • If you want to import text into a DTP application that was first created in a word processing program, what must you do?
    9·2 answers
  • What process improves the life of a computer
    11·1 answer
  • A Trojan horse is a program that copies itself repeatedly using up resources and potentially shutting down a network. true or fa
    11·1 answer
  • A location in memory used for storing data and given a name in a computer program is called a because the data in the location c
    14·1 answer
  • Pls help will give brainlest​
    15·2 answers
  • Write if true or false
    12·1 answer
  • Write an algorithm to verify a number as even​
    9·1 answer
  • A Development team begins work on a new software application and decides to involve the client’s IT experts to ensure that secur
    12·1 answer
  • What are some qualities of a good game critic? What are some qualities of a bad game critic?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!