Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

These are Visual C# questions Write instructions to do each of the following. Make up appropriate names for the variables. Create a Boolean variable and

These are Visual C# questions

  1. Write instructions to do each of the following. Make up appropriate names for the variables.
    1. Create a Boolean variable and assign it a value of True.
    2. Create a Decimal variable and assign it a value of 1.25
    3. Create a Double variable and assign it a value of 3.4.
    4. Create a String variable and assign it a value of Maybe
    5. Create a Char variable and assign it a value of X.
  2. Which of the following statements are valid?
    1. string message = Page + 1;
    2. float amt1 = 1;
    3. float amt2 = 1.0f;
    4. float amt3 = 1.0;
    5. decimal amt4 = 1.0;
  3. Assume that the variables X, Y, and N have been declared as doubles and assigned values. Write and instruction to assign a value to Y as Y = XN.
  4. Assume that txtAmount is a text box with a number in it. Write instructions to get the number and store it in each of the following variables.
    1. int amount1;
    2. double amount2;
    3. decimal amount3;
  5. Assume that txtAmt1 and txtAmt2 are textboxes and that dblAmt1, dblAmt2, and dblTotal are variables of type double. Write a try-catch block which will get the numbers from the text boxes and assign them to the corresponding variables. After that, add dblAmt1 plus dblAmt2 giving dblTotal. Display The total is and the value of dblTotal in a message box. However, if an exception occurs, catch it and display Invalid Data in a message box.

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

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions