

C# Visual Studio
using System;
using System.Collections.Generic;
using System.Text;
Below is the
code in C# for the above question:
***********************
1. ***********************
using System;
using System.Collections.Generic;
using System.Text;
namespace PracP1
{
public class Program
{
public static void Main(string[] args)
{
int n = 0;
string s = "";
// check if 2 arguments
if(args.Length == 2)
{
if(int.TryParse(args[0],out n))
{
// successful parse to use n
s = args[1]; // Second argument is character
// draw a line of characters
DrawChars(n, s);
}
else
{
// Unsuccessful parse so no n value
}
}
// Wait for user to have read the output.
Console.WriteLine();
Console.Write("<Press enter to finish>");
Console.ReadLine();
}
static void DrawChars(int n,string s)
{
// this gives the square of n lines each with n character s
for(int i=0;i < n; i++)
{
for(int j=0;j< n; j++)
{
Console.Write(s);
}
Console.WriteLine();
}
Console.WriteLine();
}
}
}
*********************** 2.
***********************
using System;
using System.Collections.Generic;
using System.Text;
namespace PracP1
{
public class Program
{
public static void Main(string[] args)
{
int n = 0;
string s = "";
// check if 2 arguments
if(args.Length == 2)
{
if(int.TryParse(args[0],out n))
{
// successful parse to use n
s = args[1]; // Second argument is character
// draw a line of characters
DrawChars(n, s);
}
else
{
// Unsuccessful parse so no n value
}
}
// Wait for user to have read the output.
Console.WriteLine();
Console.Write("<Press enter to finish>");
Console.ReadLine();
}
static void DrawChars(int n,string s)
{
// integer variable k that keep track of line number
int k = 1;
for(int i=1;i <= n; i++)
{
for(int j=1;j<= n; j++)
{
// if j is equal to i then print the number k
if (j == i)
{
Console.Write(k);
}
// else print the character.
else
{
Console.Write(s);
}
}
// incrementing k by 1.
k++;
// if k becomes greater than 9 then set k to 0.
if (k > 9) k = 0;
Console.WriteLine();
}
Console.WriteLine();
}
}
}
Refer to the
screenshot attached below to better understand the code and
indentation:
***********************
1. ***********************
*********************** 2.
***********************
Output:
1. N = 5 and S = "*"

2. N = 11 ans S =
"*"
If this answer
helps you then please upvote,
for further queries comment below.
Thank you.
C# Visual Studio using System; using System.Collections.Generic; using System.Text; 1. Modify the program to output that...
==Modify the M8B by using C#== using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace M8B { class Magic8Ball { static void Main(string[] args) { string question; Console.WriteLine("I am the Magic 8-ball! Ask me a question and I will give you an answer."); Console.Write("Your question: "); question = Console.ReadLine(); Console.WriteLine("\nLet me part the mists of the time for you."); Random rnd = new Random(); int roll =...
Fix program errors and improve code Visual Studio C# Console App (.NET Framework) Task The program must allow for the teacher to either enter a predetermined number of scores (e.g. 10 exam scores), to keep allowing them to enter in scores until they are finished. You will need to convert these scores to a percentage then store these in a list. You will perform some calculations on these results and also display the contents of the list (percentage values) back...
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 namespace ConsoleApplication1 6 { class Program { 9 static void Main(string[] args) 10 { 11 test t = new test(10); Console.WriteLine(t. Getio); Console.WriteLine(t.J); 14 } 15 } 16 class test 17 { 18 18 private int i; 19 private int j; 20 public test(int a) 21 { 22 i = a; 23 j = a +5; public int Getio return i; } public int ) 29 30...
(C#, Visual Studio) I need help modifying my program code to accommodate repeated numbers. For example, if a user inputs a repeated number the program should regenerate or ask to enter again. If needed, here is the program requirements: Create a lottery game application. Generate four random numbers, each between 1 and 10. Allow the user to guess four numbers. Compare each of the user’s guesses to the four random numbers and display a message that includes the user’s guess,...
Create a C# program in visual studios called FortuneCookie whose Main() method contains an array of at least 8 strings with fortune-telling phrases. The program should randomly select 2 different phrases and pass them to a method that displays them. A random number generator should be used to select the phrases from random positions in the array and the length of the array should be used to determine one of the random number generator range boundaries (i.e., do not hardcode...
Hello in C#. I need help understanding and knwoing what i missed in my program. The issue is, the program is supposed to have user input for 12 family members and at the end of the 12 it asks for user to input a name to search for. When i put a correct name, it always gives me a relative not found message. WHat did i miss. And can you adjust the new code so im able to see where...
In C programming language: This program will output a right triangle based on user specified height triangleHeight and symbol triangleChar. (1) The given program outputs a fixed-height triangle using a * character. Modify the given program to output a right triangle that instead uses the user-specified triangleChar character. (1 pt) (2) Modify the program to use a nested loop to output a right triangle of height triangleHeight. The first line will have one user-specified character, such as % or *....
You must first compile both .cs file into .exe. Then, run the server in one command prompt window and run two cilents, each in a separate command prompt window. To quit a client, you may enter no book title but just hit the enter or enter Ctrl-C. The server always displays a message whenever a client is connected and disconnected. <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key = "U101" value="PHYSICS"/> <add key = "U102" value="EDU"/> <add key = "U103"...
Complete a program In C#: some code is included, you edit the areas that have not been filled. For your C# program you will complete code that plays the War card game. In this game, the deck of cards is evenly divided among two players. The players are not allowed to look at the cards in their hand. On each round of the game, both players lay down the top card from their hand. The player with the higher value...
Modify the program so that it uses a loops repeatedly doing: • prompt for input (using line seqNum and the prompt phrase: "Enter a line") • reads the line of input • stores the line of input in the next position of an array of Line or an ArrayList of Line. Once the user enters STOP as input, the loop should terminate and another loop should print each line in reverse order. For example (the input you should type in...