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
kondaur [170]
3 years ago
9

This program will output a right triangle based on user specified height triangle_height and symbol triangle_char. (1) The given

program outputs a fixed-height triangle using a * character. Modify the given program to output a right triangle that 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)
Computers and Technology
1 answer:
Arturiano [62]3 years ago
4 0

Answer:

See explaination

Explanation:

triangle_char = input('Enter a character:\n')

triangle_height = int(input('Enter triangle height:\n'))

print('')

for i in range(triangle_height):

for j in range(i+1):

print(triangle_char, end = " ")

print()

You might be interested in
Higher Order Functions used for simulations of dice rolls. Definition: An n-sided dice function takes no arguments and always re
tiny-mole [99]

Answer:

#include <iostream>

#include <time.h>

#include <string>

using namespace std;

int main(){

srand(time(NULL));

cout<<"Throw dice"<<endl;

int b =0;

int a=0;

a=rand()%6;

b=rand()%6;

for (int i =0;i<1;i++)

{cout<<"dice one: "<<a<<endl;}

for (int i =0;i<1;i++)

{cout<<"dice two: "<<b<<endl;}

if(a>b)

{cout<<"first dice won"<<endl;}

if(b>a)

{cout<<"second dice won"<<endl;}

else{cout<<"they are same"<<endl;

return main();

}

return 0;

}

Explanation:

/*best dice roll game just for you change it as you want but all necessary things are there/*

5 0
2 years ago
Decrypt this message: P ht uva h zwf
KatRina [158]
Translation: I am a spy
5 0
2 years ago
What is the formula equivalent to the function =SUM(B1:B5)? A. =B1+B5 B. =$B$1+$B$5 C. =B1+B2+B3+B4+B5 D. =$B$1+$B$2+$B$3+$B$4+$
Contact [7]

Given the options, I would choose Option C. =B1+B2+B3+B4+B5.

5 0
3 years ago
Pleasee help meeeeeeeeee I’m stuckk!!!!
Anit [1.1K]

Answer: Charles Babbage

4 0
2 years ago
Read 2 more answers
Which feature of vitualization helps increase the IT productivity of a business?
laila [671]
A the answer is yes
7 0
3 years ago
Other questions:
  • You should use _____ software for writing a letter.
    10·1 answer
  • Emma has decided that she needs to assess the risk and return of buying an extended warranty for her new laptop for school
    15·1 answer
  • You can use ???? a to test tread wear on your tires
    14·2 answers
  • What should you do before cleaning the top of a storage battery and rinsing it with fresh water?
    12·1 answer
  • Discuss a situation in which you might want to use a floating-point number with a fractional part for a loop control variable. W
    5·1 answer
  • __________ is a collection of formatting options—such as a frame, a rounded shape, and a shadow—that changes a picture’s overall
    5·1 answer
  • IOS jail broken or Android unrooted which is better to hack with
    6·1 answer
  • Which key should you press and hold to select multiple cells?
    8·2 answers
  • Which item is used for formatting in responsive web design?
    14·2 answers
  • The process of identifying and removing logical errors and runtime errors is called ..............
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!