Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Help me write this 30 bytes rewards

Hi guys, this might be one of the stupidest post you've seen but Im new to C# and need you help with this

"Write a program named GreenvilleMotto that displays the competition’s motto, which is “The stars shine in Greenville.” Edit the program so that it displays the motto surrounded by a border composed of asterisks."

Thanks lol
Will give 30 bytes for person who helps
string motto = "The starts shine in Greenville.";
StringBuilder display = new StringBuilder();

void printMotto(){
for(int i = 0; i < (motto.Length + 4); i++){
display.Append('*');
}
display.Append('\n* ');
display.Append(motto+" *\n");
for(int i = 0; i < (motto.Length + 4); i++){
display.Append('*');
}
display.Append('\n');
Console.Write(display.toString());
}

Something like that havent tested it.
But you should be able to figure it out from here.
If not feel free to pm me.

Edit: changed code slightly. Also you have to make sure to call the method from your main.
(Jan 13, 2019 09:59 AM)SIM-3364521 Wrote:  string motto = "The starts shine in Greenville.";
StringBuilder display = new StringBuilder();

void printMotto(){
for(int i = 0; i < (motto.Length + 4); i++){
display.Append('*');
}
display.Append('\n* ');
display.Append(motto+" *\n");
for(int i = 0; i < (motto.Length + 4); i++){
display.Append('*');
}
display.Append('\n');
Console.Write(display.toString());
}

Something like that havent tested it.
But you should be able to figure it out from here.
If not feel free to pm me.

Edit: changed code slightly. Also you have to make sure to call the method from your main.
It gave me couple of error not sure which
Challenge accepted
[Image: n2Imy2G.png]
[Image: Syr3DlV.png]
(Jan 13, 2019 10:38 AM)gigajew Wrote:  Challenge accepted

Thank you! I sent you 35 Bytes!
dude did you just paste this into a class and expect it to run just like that?
i just showed you how one could do it.
Didnt paste the whole class here so thats why you get errors.

-missing imports
-no class head
-no main
(Jan 13, 2019 02:22 PM)SIM-3364521 Wrote:  dude did you just paste this into a class and expect it to run just like that?
i just showed you how one could do it.
Didnt paste the whole class here so thats why you get errors.

-missing imports
-no class head
-no main

I already sent you 20 bytes


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by lol3771Mar 31, 2018 02:15 AM 0 293 Mar 31, 2018 02:15 AM
Last Post: lol3771
[C#] by SiliconSep 30, 2011 05:42 AM 2 116 Sep 30, 2011 05:42 AM
Last Post: Nonmod
[C#] by sn4pcr4kJul 30, 2011 07:14 PM 3 83 Jul 30, 2011 07:14 PM
Last Post: sn4pcr4k