Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use R script to answer Write a function called trianglrf) that prints a triangle composed of asterisks. The function's argument is h (the triangle's height

image text in transcribeduse R script to answer

Write a function called trianglrf) that prints a triangle composed of asterisks. The function's argument is h (the triangle's height - imagine that R's output is rotated to the lefl). For example, It is generated by specifying h=6. Other sample outputs are: \begin{tabular}{|l|l|} \hline \multicolumn{1}{|c|}{h=2} & \\ \hline & h=5 \\ \hline & \\ & \\ & \\ \\ \\ & \\ & \\ \\ & \\ & \\ \hline \end{tabular} As you go through the items below, the state of the trianglr0 function improves. 1.) Create the triangir0) function without any input validation yet. 2.) Copy your codes from the previous item. Add input validation to the triangir0 function. The value of h must be a positive integer from 2 to 10 only. 3.) Copy your codes from the previous item. Specify a default value (h=5) for the trianolr0 function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Identify how culture affects appropriate leadership behavior

Answered: 1 week ago