What is wrong with the following declaration?

Assignment Help Basic Computer Science
Reference no: EM13842210

1. Which of the following is a valid C# identifier?

a. 2a_big_Car

b. __STOP

c. ha*t123

d. skidoo-

e. none of the above

2. (True or False) 3000000000 is a valid C# value of the int type?

3. The symbols for comments are:

a. // for a single line and /* */ for multiple lines

b. /* */ for a single line and // for multiple lines

c. /* for a single line and /* */ for multiple lines

d. none of the above

In Questions 4-7 assume integer variables x=10, y=5, z=3, w=2.

4. The value of x + y % w is

a. 1

b. 11

c. 12

d. none of the above

5. The value of x / z * y is

a. 16 2/3

b. 0

c. 15

d. none of the above

6. The value of w *= y + z is

a. 13

b. 16

c. 18

d. none of the above

7. The value of (x++ + --y) - (++x + y--) is

a. 0

b. 1

c. -1

d. 2

e. -2

 

8. Which of the following is not a C# keyword?

a. class

b. public

c. main

d. int

e. none of the above

9. What is wrong with the following declaration?

int switch;

switch =5;

10. Which expression

i) 5 + (7* 3) or ii) (5 + 7) * 3

has the same value as the expression 5 + 7 * 3?

11. What will be the output when the following code fragment is run?

int x = 12, y = 14, z;

z = y / x +7;

x = z * z;

System.Console.WriteLine(x);

12. Which of the following statements, if any, have the same result for integers? x and y?

a. x += y;

b. y += x;

c. x = x + y;

13. Write a C# code to compute the value of the polynomial x4 + x2 +9x - 7.

14. Write a C# program to compute the perimeter of a square of length a.

15. Write a C# program that takes one number from the user and shows whether this number is odd or even.

Reference no: EM13842210

Questions Cloud

Differences between economic and accounting concepts of cost : What are the differences between economic and accounting concepts of cost. How are prices determined under perfect competition
What is the wavelength of neutrons traveling : What is the wavelength of neutrons traveling
Lisp programming and prolog : You have to do all the assignment need its lisp programming and prolog also, the question 2 do it from Microsoft word please i want perfect assignment also, please no plagiarism and no website its very important to me
Business to start with little capital : Could you tap a skill you already possess. For example, could you be a foreign language tutor Compile a list of all the business opportunities you have discovered and share them with your classmates. What are they willing to pay for your products ..
What is wrong with the following declaration? : What is wrong with the following declaration?
Construct an extensive form of the game : Consider the following discrete version of the ultimatum game. Player 1 offers to give x ∈ {0,1/2,1} to player 2. If player 2 says "Y," then player 2 collects x and player 1 receives the remainder, 1- x . If player 2 says "N," then each gets zero.
How would the transaction be recorded by silica labs : The stock is forecasted to double in market value over the next two months. How would this transaction be recorded by Silica Labs?
Why do commercial banks object to brokerage houses : Why do commercial banks object to brokerage houses being allowed to offer many of the same services.
Personal liability is a serious issue in purchasing : Personal liability is a serious issue in purchasing

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd