Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are writing a program that needs to use Euler's Constant (0.57721566). Indicate how you would declare this value in C#. For Q#26-32, evaluate the

  1. You are writing a program that needs to use Euler's Constant (0.57721566). Indicate how you would declare this value in C#.

For Q#26-32, evaluate the C# assignment statements and give the final resulting value assigned to the left-hand-side variable.

    1. int N = Convert.ToInt32(18.5);
    2. int X = Math.Ceiling(43 % 4 + Math.Pow(14.3, 3) / 70 1000 * Math.PI / 5 );
    3. string Y ="20"+"14";
    4. double A = Math.Floor(5 - 12.74);
    5. double A = Math.Round(5 1.74);
    6. double A = Math.Round(5 - 1.74 , 1) ;
    7. int X = 2; X*=X+4
    1. Evaluate the following C# assignment statement and give the resulting value assigned to the left-hand-side variable:

int x1 = Convert.ToInt32(Math.Ceiling(43 % 6 + 23 / Math.Pow(2,7) - 1000 / 26 ));

  1. Find the final value of X:

int X=0, N=0;

Single M = (Single) 42.3;

N = 3;

X = Convert.ToInt32(X + Math.Pow((M / N), N) + Math.Log(M) / Math.Pow(8.3, 2.0) + 12 * M);

  1. Given that double X=4.5, Y=3.2, Z=1 and Boolean B=False, evaluate each of the following Boolean expression:

X<=5 | ((Z/2) > 1 & ! B)

  1. Given: int A = 3, B=5; double C=3.14; string S = "123"; object R=4.32; Indicate if the following assignments are correct or, if not, correct them with any needed conversions and/or typecasts. For each, assume the variable values given above, not the values from the previous subparts.
    1. C = A;
    2. A = C;
    3. A = S;
    4. C = R;
  2. Write a console program to calculate the number of square feet of shingles needed to cover a gable (upside down V) roof. From the user, read in a) the length of the roof, b) the width of the roof, and c) the rise (number of feet roof rises vertically for every foot horizontally). To simplify, assume there are no eaves (overhang).

  1. Repeat the previous problem using Python.

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

Students also viewed these Databases questions

Question

When is it appropriate to use a root cause analysis

Answered: 1 week ago