Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Some of the questions relate to Visual C# What are the rules for writing a valid variable name? What is a local variable? What is

Some of the questions relate to Visual C#

  1. What are the rules for writing a valid variable name?
  2. What is a local variable?
  3. What is the scope of a variable?
  4. What is the lifetime of a variable?
  5. 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.
  6. 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;
  7. What are the operators for each of the following?
    1. addition
    2. subtraction
    3. multiply
    4. divide
    5. modulus
    6. concatenation
  8. 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.
  9. 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;
  10. 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.
  11. Assume that dblPrice has a number in it of type double. Write an instruction to convert the number into a string (formatted as currency) and assign it to a label named lblPrice.
  12. Define TAX_RATE as a named constant with data type of decimal and a value of 0.115.
  13. What is the tab order for a form? How can it be set?
  14. What is an accept button on a form? How is it determined?
  15. What is a cancel button on a form? How is it determined?
  16. What is an access key for a button? How is it determined?
  17. Write an instruction that will assign the focus to a text box named txtName.
  18. How are group boxes and panels used by a program? How are they different?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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