Question: I need help with this assignment Create a Kotlin program that prints a right triangle with a base of 5 K's: K KK KKK KKKK

I need help with this assignment

Create a Kotlin program that prints a right triangle with a base of 5 K's:

K KK KKK KKKK KKKKK 1. First, use a while loop

2. Then use a for-loop

3. Print the triangle upside down with a reversed for-loop

4. Create a function that prints the triangle with any symbol and any base, and demonstrate with 10 K's.

Be sure to comment your code, and name your variables appropriately.

If you used the Kotlin playground, copy your program into a text file and name the file Yourname.Kt and upload the file here. If you used Android Studio, you can either ZIP the entire project or simply upload the MainActivity.kt file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!