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
Write a void function SelectionSortDescendTrace() that takes an integer array, and sorts the array into descending order. The fu
salantis [7]

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

void SelectionSortDescendTrace(int numbers[], int numElems) {

int maxInd;

for (int i = 0; i < numElems - 1; ++i) {

maxInd = i;

for (int j = i; j < numElems; ++j) {

if (numbers[j] > numbers[maxInd]) {

maxInd = j;

}

}

int temp = numbers[i];

numbers[i] = numbers[maxInd];

numbers[maxInd] = temp;

for (int j = 0; j < numElems; j++) {

cout << numbers[j] << " ";

}

cout << endl;

}

}

int main() {

int numbers[10];

int numElements = 0;

for (int i = 0; i < 10; i++) {

cin >> numbers[i];

if (numbers[i] == -1)

break;

++numElements;

}

SelectionSortDescendTrace(numbers, numElements);

return 0;

}

8 0
3 years ago
Which does plug-and-play refer to?
vlabodo [156]
The answer is c the ability for the os to detect
7 0
2 years ago
If you design your pages using a font that your user does not have installed, the browser defaults to ____ on a macintosh.
sveticcg [70]
The browser should default to Calibri (body)
3 0
2 years ago
What are some tasks for which you can use the VBA Editor? i need help for my computer class.
Murljashka [212]

Answer:

Visual Basic for Applications runs as an internal programming language in Microsoft Office applications such as Access, Excel, PowerPoint, Publisher, Word, and Visio. VBA allows users to customize beyond what is normally available with MS Office host applications by manipulating graphical-user-interface (GUI) features such as toolbars and menus, dialogue boxes, and forms. You may use VBA to create user-defined functions (UDFs), access Windows application programming interfaces (APIs), and automate specific computer processes and calculations. Macros can automate just about any task—like generating customized charts and reports, and performing word- and data-processing functions. Programmers,like replicating large pieces of code, merging existing program functions, and designing specific languages. VBA can also work in non-Microsoft settings by using a technology called "COM interface," which allows commands to interact across computer boundaries. Many firms have implemented VBA within their own applications, both proprietary and commercial, including AutoCAD, ArcGIS, CATIA, Corel, raw, and SolidWorks.

<em>(Hope this helps/makes sense!)</em>

6 0
3 years ago
Vkq-jnfi-uif se-x fun girls joi-n mee-t usin-g this cod_e​
liberstina [14]

Answer:

Why?

Explanation:

7 0
2 years ago
Other questions:
  • What types of automation device might require specialist installer training?
    5·1 answer
  • What is master slide and tell about master slide
    6·1 answer
  • The set of folders and subfolders that MATLAB searches through to locate a command or M-file is called the ___________.(fill in
    9·1 answer
  • On the Attendance worksheet, in cell L5, enter an IF function to determine if the percentage in cell K5 is greater than or equal
    9·1 answer
  • Is an automatic computer check to ensure that the data entered is sensible and reasonable.It does not check the accuracy of data
    7·1 answer
  • Consider the following class definition.
    7·1 answer
  • In which of the following stages of the development process is a team MOST likely to interview a potential user of an app?
    6·1 answer
  • How much do you think it would cost to develop an app?
    14·2 answers
  • How do you initiate a sprite’s actions in a scene?
    8·1 answer
  • A program that organizes sequences of automated provisioning tasks. A. Application Packager B. Sequence Manager C. Sequence Logg
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!