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

  Hardware r us" it consulting and managing firm

A star consultant from "Hardware R US" IT consulting and managing firm. Just graduated from APUS and this is your first critical job.

  Which operators are not defined for an array

There are 8 attributes for a variable: Name - a valid C/C++ identifier. No spaces, special characters (!,$,#, etc), must begin with a letter, can not be a reserved word Address - location in memory where value is stored.

  Pieces of information is contained within an ip address

What two pieces of information is contained within an IP address? How does the computer tell the difference between these two parts?

  Compute the transmission line utiliza

Consider that packets arrive at an internet router from 3 different other routers, each with Poisson arrivals with l = 4 per second. The packets are all transmitted on the same transmission line

  Create a program that reads number of dooflingies

The shipping clerk at Rinky Dooflingy Corporation is faced with the problem: Dooflingies are very deilicate and must be shipped in special containers.

  Find the second largest element of a set of n elements drawn

Find the second largest element of a set of n elements drawn from an arbitrary totally ordered set in as small a number of comparisons as possible. Only binary comparisons are allowed.

  Clg lyk colg placement information

CLG lyk colg placement information and tieup with companys information

  Define a class for complex number

Define a class for complex numbers. A complex number is a number of the form a + b*i where for our purposes, a and b are numbers of type double, and i is a number that represents the quantity sqrt(-1).

  Guest lecturer at a local university for an ethical hacking

Imagine you've been sought out as a guest lecturer at a local university for an ethical hacking course. You have been asked to prepare a paper for the students, as well as a PowerPoint presentation, regarding the use of cryptography in corporations t..

  What some of the ways you would troubleshoot a dns problem

What are some of the ways you would troubleshoot a DNS problem

  Display a graphical representation of the binary search tree

The program should display a graphical representation of the binary search tree. Show all the leaf nodes; Show all the nodes in PreOrder, InOrder and PostOrder traversals.

  What window events can a program handle

What window events can a program handle? Explain the difference between the WindowListener interface and the WindowAdapter.

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