Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. If you follow the recommendations from this week, which of the following is true? (Choose two) a. Your program will always work b. Your

1. If you follow the recommendations from this week, which of the following is true? (Choose two)

a. Your program will always work

b. Your program will be easier to read

c. Your programs will always be perfect

d. Other programmers will be more likely to work with you

2. Fix four flaws in the following program.

// Fix four flaws // Note: there are more than four flaws!

static void Main(string[] args) { string userName = Console.ReadLine(); DoLotsOfstuff(userName); }

static void DoLotsOfstuff(string n) { bool guest; int i;

if (n = "Student") { Console.WriteLine("Welcome " + n); guest = false; } else if (n = "Admin") { Console.WriteLine("Welcome " + n); guest = false; } else { Console.WriteLine("Welcome " + n); guest = true; }

for (i = 0; i < len(n); i++) Console.Write(n[i]); Console.WriteLine(); }

You will need to retype this program into C#, and then make changes. For ease of grading, please mark your changes with comments, such as:

// Change 2: Changed the variable name from n

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

=+ What would it look like? Who should deliver it?

Answered: 1 week ago