if false explain why Question : C# .net questions 1. Write a command that reads
ID: 3711216 • Letter: I
Question
if false explain why
Question: C# .net questions 1. Write a command that reads input from the command line and stores it as a in...
c# .net questions
1.
Write a command that reads input from the command line and stores it as a int variable named
favorite_number.
2.
Assume you have a variable 'name'. Use String Interpolation to output "Hi" and the value assigned to the
name variable
3.
Rewrite the following if else block as a single line using the Conditional Operator ?
weather = ""
if ( temp > 32 )
weather = "Rain";
else
weather = "Snow";
4.
given an array of an unknown size, write a loop that will print all the values in the array
5.
Write a method header ( not the whole thing ) OrderCoffee that accepts a string for size, and Booleans for
cream and sugar. Default both cream and sugar to false.
pt 2
if false explain why
1. T/F - Forms applications differ from console based applications in that they are Event driven and must be built to
respond to events from the user.
2. T/F – Getting user input from a textbox can be done by using the Text property on the textbox object
3. T/F – When using Radio buttons, buttons that are near to each other will automatically group themselves so that only
one button can be selected at a time.
4. T/F – Each component must have it’s own unique event handler method.
5. T/F – A best practice is to decouple the UI components from the business logic
6. T/F – When writing unit tests, it’s best to have a single test method to hold all the logical tests
7. T/F – In an ideal world, unit tests would be extensive enough to ensure that when they are run, every line of code of
the class it is testing is ran.
8. T/F – If we achieve that ideal world from 7 above, we are guaranteed to have a bug free program
9. T/F – Any code that is worth writing is worth testing
10. Why does the code we write for Forms applications get put into a ‘partial’ class?
Explanation / Answer
If you post more than 1 question, as per chegg guidelines I have to solve only first question.
Ques 1.
// args is the array to store the arguments
public static void Main(string[] args)
{
// Convert.ToInt32() converts string into int
int favorite_number = Convert.ToInt32(args[0]);
}
Ques 2.
Console.WriteLine("Hi" + name);
Ques 3.
weather = temp > 32 ? "Rain" : "Snow";
Ques 4.
for( i = 0 ; i < arr.Length ; i++ )
Console.WriteLine(arr[i]);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.