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

  Under a mle-estimated unigram probability model

Qatar university, the largest university in qatar, aims to become the role model university in qatar and the arab region. it is also the only university in qatar that offers information retrieval courses.

  Which structure best for the storyboard created

Case 2-3 Michael wants to create a Website based on his famous cooking show. He would like to provide instructions on how to create some of his favorite dishes. He would like his recipes to be displayed in very simple, step by step pages. Which st..

  Explain sequences of signals that occur on address bus

Explain the sequences of signals that occur on address bus, control bus, and data bus when a simple microcomputer fetches an instruction.

  Estate agents and an office manager in the office.

A new real estate company that would like to set up a Windows network in their office. (There is currently nothing in place.) They currently have ten real estate agents and an office manager in the office.

  Program specifications for a simple business problem

Given a set of program specifications for a simple business problem requiring iteration, code and test a program that meets the specifications and employs best programming practices.

  Secure encrypted communications

Transmitting personal and business data and information over secure communication channels is critical. In some cases it is required, especially when personally identifiable information is being transmitted. Credit card numbers, Social Security Numbe..

  Identify how the problem could be discovered and fix

Identify at least 2 things that could be wrong with each of the following elements. Identify how the problem could be discovered and how to fix the problem

  Develop a program integrating php and html together that all

Develop a program integrating PHP and HTML together that allows a user to select two books from a dropdown list, then calculates the subtotal, tax, and total.

  Receive the measurement for the diam-eter of a circle

Design an algorithm that will prompt for and receive the measurement for the diam-eter of a circle, and calculate and display the area and circumference of that circle. Your program is to continue processing until a sentinel of 999 is entered.

  Item number in the inventory

Write a console program that will ask the user for an item number in the inventory and display the name of that item. Stay in a loop so that the user may enter the item number multiple times. Use the letter E to exit the application. Show an error me..

  Explain the use of current technologies fight cyber crime

Explain to the university (in a whitepaper) the characteristics of high-tech crime also known as Internet, cyber, and computer crime. Explain the use of current technologies to both carry out and fight cyber crime.

  Write a program that creates a binary tree from an array

Write a program that creates a Binary Tree from an array of integers, goes through it using inorder traversal (saving that to another array), then makes another balanced binary tree.

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