7 kyu

Print a Rectangle Using Asterisks

123 of 949GrahamD

Description:

Write a method that, given two arguments, width and height, returns a string representing a rectangle with those dimensions.

The rectangle should be filled with spaces, and its borders should be composed of asterisks (*).

For example, given width = 3 and height = 3:

***
* *
***

End each line of the string (including the last one) with a carriage return-line feed combination.

Note: You may assume that width and height will always be greater than zero.

Strings
ASCII Art
Algorithms

More By Author:

Check out these other kata created by GrahamD

Stats:

CreatedJun 7, 2017
PublishedJun 12, 2017
Warriors Trained1710
Total Skips15
Total Code Submissions4223
Total Times Completed949
C# Completions123
JavaScript Completions791
Ruby Completions55
Total Stars22
% of votes with a positive feedback rating87% of 238
Total "Very Satisfied" Votes186
Total "Somewhat Satisfied" Votes43
Total "Not Satisfied" Votes9
Total Rank Assessments12
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • GrahamD Avatar
  • smile67 Avatar
  • leesc22 Avatar
  • hobovsky Avatar
  • Just4FunCoder Avatar
  • farhanaditya Avatar
Ad