small code builds for .net

 In this lab, you will learn how to use the if-else double-selection statement.

Perform the following tasks in the C# block:

Declare a static public and character function grade with the parameter as marks having the datatype as integer.
Declare a character variable grd.
Use an if condition to check if the marks obtained are greater than 89 and less than 101, then return the variable grd as A.
Use the else if condition to check if the marks obtained are greater than 59 and less than 90, then return the variable grd as B.
Use the else condition to return the variable grd as C, if marks obtained are less than 59.
Return the value of the variable grd using the return keyword.

Note: In the C# block, replace the comments with the appropriate code, if required.

Sample input:

93
Sample output:

A

QUESTION 2

 In this lab, you will learn how to use the switch multiple-selection statement.

Complete the given code in the C# block by performing the following tasks:

Check the condition of the entered value and redirect it to the specific case.
For cases ‘+’, ‘-‘, ‘*’, and ‘/’, add, subtract, multiply, and divide the variables a and b, respectively, store the result in the variable result, and take the control outside the switch block using the break statement.

Note: In the C# block, replace the comments with the appropriate code, if required.

Sample input:

8
8
*
Sample output:

64

QUESTION 3

 In this lab, you will learn how to use the while loop.

Complete the given code in the C# block by performing the following tasks:

Declare an integer variable count and set its initial value as 0.
Declare a while loop with the test condition as n > 0.
Increment the value of the variable count by adding the variable n to it.
Decrement the value of the variable n by 1.
Return the final value of the variable count as the returning value of the function after the control comes out of the iteration statement.

Note: In the C# block, replace the comments with the appropriate code, if required.

Sample input:

12
Sample output:

78

QUESTION 4

 In this lab, you will learn how to use the do-while loop.

Complete the given code in the C# block by performing the following tasks:

Declare and initialize the value of the variables result and i as 1.
Declare a do-while loop to store the product of the variables i and result in the variable result within the loop.
Increment the value of the variable i by 1, each time the loop executes.
Add a test condition for the do-while loop in such a way that the loop executes till the value of the variable i becomes greater than a.
Return the calculated value of the variable result using the return keyword.

Note: In the C# block, replace the comments with the appropriate code, if required.

Sample input:

5
Sample output:

120

QUESTION 5

 In this lab, you will learn how to use the for loop.

Complete the given code in the C# block by performing the following tasks:

Declare and initialize the variable fact as 1.
Declare a for loop with an initial value of the variable i as 1, test condition as i <= a, and increment value of the variable i by 1.
Calculate the product of the variables i and fact, and store it in the variable fact.
Return the calculated factorial stored in the variable fact using the return keyword.

Note: In the C# block, replace the comments with the appropriate code, if required.

Sample input:

5
Sample output:

120

QUESTION 6

 In this lab, you will learn how to use the for loop.

Complete the given code in the C# block by performing the following tasks:

Assign the Boolean value true to the variable prime using the bool function.
Use the if condition to check whether (a==1) returns false or (a==2) returns true.
Initialize the for loop with the variable i whose initial value is 2 and execute the loop until the value of the variable i becomes less than or equal to a/2.
Use the if condition to check whether the variable a returns 0 when it is divided by i.
If the above condition is true and the remainder of a/i is zero, then set the value of the Boolean variable prime as false.
Set the variable prime as the returning value of the function.

Note: In the C# block, replace the comments with the appropriate code, if required.

Sample input:

97
Sample output:

True

QUESTION 7

 In this lab, you will learn the concept of functions and work with them.

Complete the given code in the C# block by performing the following tasks:

Declare a static public and integer function Average with five parameters as a, b, c, d, and e having the datatype as float.
Calculate the average of the five variables and save it in the integer variable avg.
Set the variable avg as the returning value of the function Average.

Note: In the C# block, replace the comments with the appropriate code, if required.

Sample input:

10
20
30
40
50
Sample output:

30

QUESTION 8

 In this lab, you will learn the concept of functions and work with them.

Complete the given code in the C# block by performing the following tasks:

Declare a static and non-returning value function using the void keyword with the name Add and two integer parameters as x and y.
Declare an integer variable sum and store the sum of the variables x and y in the variable sum.
Use Console.WriteLine() to display the value of the variable sum.

Note: In the C# block, replace the comments with the appropriate code, if required.

Sample input:

10
20
Sample output:

30

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 15% with the discount code SUCCESS