Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C# assignment: Saying Create an application that produces three different output

ID: 3874910 • Letter: C

Question

C# assignment: Saying
Create an application that produces three different outputs using the same phrase. Select your own favorite popular saying for the phrase. The phrase should first be displayed on a single line. The output should be displayed with white background and black text. Use at least three Write( ) methods—but display the output on a single line. Next, print the phrase on three separate lines, again using only Write( ) methods. For your third and final output, print your favorite say- ing one word per line. Decide which combination of Write( ) and/or WriteLine( ) would be the most streamlined approach. Label each out- put. Following is an example of what the final output would look like using a favorite saying of the author:

Output #1 Laugh often. Dream big. Reach for the stars!? Output #2 Laugh often Dream big. Reach for the stars! Output #3 Laugh often Dream big, Reach for the stars!

Explanation / Answer

using System;

public class Test
{
public static void Main()
{


  // use for tab and for new line
  Console.WriteLine(" Output #1 ");
  Console.Write(" Laugh often, ");
  Console.Write("Dream big, ");
  Console.Write("Reach for the stars!");
  
  Console.WriteLine(" Output #2 ");
  Console.Write(" Laugh often, Dream big, Reach for the stars!");
  
  Console.WriteLine(" Output #3 ");
  Console.Write(" Laugh often, Dream big, Reach for the stars! ");
  
}
}

Output:

Output #1
Laugh often, Dream big, Reach for the stars!
Output #2
Laugh often,
Dream big,
Reach for the stars!
Output #3
Laugh
often,
Dream
big,
Reach
for
the
stars!