Problem:
Solution:
using System.Text;
using System.Threading.Tasks;
namespace helloWorldInAFrame
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("*********************");
Console.WriteLine("*" + " " + "Hallo " +" " +"**");
Console.WriteLine("*" + " " + "world " + " " + "***");
Console.WriteLine("*" + " " + "in " + " " + "***");
Console.WriteLine("*" + " " + "A Frame " + " " + "**");
Console.WriteLine("*********************");
Console.ReadKey();
}
}
}
Write a function that takes a list of strings an prints them, one per line, in a rectangular frame. For example the list
["Hello", "World", "in", "a", "frame"]
gets printed as:*********
* Hello *
* World *
* in *
* a *
* frame *
*********
Solution:
using System.Text;
using System.Threading.Tasks;
namespace helloWorldInAFrame
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("*********************");
Console.WriteLine("*" + " " + "Hallo " +" " +"**");
Console.WriteLine("*" + " " + "world " + " " + "***");
Console.WriteLine("*" + " " + "in " + " " + "***");
Console.WriteLine("*" + " " + "A Frame " + " " + "**");
Console.WriteLine("*********************");
Console.ReadKey();
}
}
}
No comments:
Post a Comment