Results 1 to 15 of 15

Thread: Can someone help me in C# (i'll treat ya with RSGP <3)

  1. #1
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default Can someone help me in C#

    heyyy i need some help in C# ... basically a multiple question thing.
    THESE QUESTIONS:





    1 Which of the following is a valid identifier?
    A. namespace
    B. variable 1
    C. exampleOfAValue
    D. 3value
    E. value#1


    2 The number 768 is an example of a ________type.
    A. bool
    B. integer
    C. floating-point
    D. struct
    E. decimal


    3 Which of the following is a reference type?
    A. int
    B. bool
    C. string
    D. decimal
    E. integer


    4 The character that cannot be used with an identifier is:
    A. .
    B. $
    C. *
    D. #
    E. all of the above


    5 Which of the following is a reserved keyword?
    A. Console
    B. data
    C. int
    D. System
    E. all of the above



    6 One of primary differences between float, double, and decimal is:
    A. float is used to represent more significant digits.
    B. double is normally used with large monetary values.
    C. decimal is not used to display negative values.
    D. double does not require suffixing a numeric literal with a value such as m or f.
    E. decimal is primarily used to represent small monetary values that require a $ for formatting.


    7 Which of the following is a valid declaration for a variable to store the name of this textbook?
    A. string name of book;
    B. char nameOfBook;
    C. boolean nameOfBook;
    D. string bookName;
    E. char book Name;


    8 Types are implemented in C# using:
    A. classes
    B. types
    C. objects
    D. names
    E. programs


    9 An object of the int class is:
    A. 47.98
    B. 47
    C. int class
    D. type object
    E. type interger


    10 What would be an appropriate declaration for a variable to indicate whether a value has reached its upper limit?
    A. int upperLimit;
    B. upperLimit reached;
    C. bool upperLimit;
    D. Boolean upperLimit;
    E. string upperLimit;







    11 Adding the keyword const to a declaration:
    A. places a value in memory that cannot be changed
    B. declares variables of the constant type
    C. must be done by placing it after the identifier in the declaration
    D. can only be done with the integral types
    E. is prohibited in C#


    12 Which statement increases the result by 15?
    A. 15 + = result;
    B. 15 =+ result;
    C. result =+ 15;
    D. result += 15;
    E. result = 15 +;


    13 What is stored in the variable ans as a result of the arithmetic expression, given the following declarations?

    int ans = 0, vl = 10, v2 = 19;
    ans = --v2 % vl++;

    A. 1.8
    B. 9
    C. 8
    D. 2
    E. none of the above


    14 What is stored in variable ans as a result of the arithmetic expression, given the following declarations?

    int ans = 10
    int vi = 5;
    int v2 = 7;
    int v3 = 18;

    ans += vi + 10 * (v2-- / 5) + v3 / v2;

    A. 18
    B. 32
    C. 28
    D. 30
    E. none of the above


    15 Which of the following formats the number 86 to display with two digits to the right of the decimal?
    A. {O:C}
    B. {O:c}
    C. {0:f2}
    D. all of the above
    E. none of the above


    16 Check mark the expressions that are valid identifiers?
    If they are invalid, indicate why.
    A. intValue      
    B. value#l      
    C. the first value      
    D. _value1      
    E. AVALUE      


    17 For each of the following, code a variable decalaration using the best choice for data type

    A. a counter for the number of correct responses
         

    B the amount of money you owe on a credit card
         

    C the name of your hometown
         

    D the grade you hope to obtain on the next exam


    E the letter grade you hope is recorded at the end of the term for this course
         


    18 For each of the variable declarations in problem 18, add an appropriate compile-time initialization.

    A. counter for the number of correct responses begins with zero
         

    B amount of money you owe on a credit card is zero
         

    C name of the hometown or the city where your school is located
         

    D grade on the next exam is 100
         

    E grade to be recorded at the end of the term for this course is an A
         


    19 int x = 2;
    int y = 6;
    int z = 10;

    What will be value of each of these variables after each of the following statements is executed? (For each exercise, use the original declaration..

    x y z
    A. z += ++y % 2;                  
    B. x = y + 14 - z / 7;                  
    C. x = y * z / 2 - x * z;                  
    D. x %= --z - y * 2;                  
    E. y = (z - y) * 2 + --y;                  


    20 double x = 2.5;
    double y = 6.9;
    double z = 10.0;

    What will be value of each of these variables after each of the following statements is executed? (For each exercise, use the original declaration.

    x y z
    A. z *= y++ % 7;                  
    B. x = (int) y + (14 - z /7);                  
    C. x = z / 3 * --y;                  
    D. z /= (int) y / x;                  
    E. z = x + Y / 4;                  


    21 What will be the output from each of the following statements?
    A. Console.Write("Result is {O:c}", 67);      
    B. Console.Write("Number {O:fO} is {1:c}", 1,3);      
    C. Console.Write("{O:fO}- {1:c}", 1,3 * 2);      
    D. Console.Write(" {O:fO} result" + "xyz {1:f2}", 1,25);      
    E. Console.Write("This is the {O:fO}st example: {1:f2}", 1,3);      


    22 Explain how a variable differs from a constant.
         


    23 Explain how type, class, and object are related to a string.
         

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Why not just ask here? Anyone with the proper knowledge would help you, I'm sure of it, no matter what you paid or didn't pay.
    There used to be something meaningful here.

  3. #3
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Once i get home i'll make sure to post the questions.

  4. #4
    Join Date
    May 2008
    Location
    Hellfire Fl.
    Posts
    124
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    haha hi pinky long time no see *Lol i always say that when i see you xD*

    C# huh? you advanced since the last time i saw you :P gg bro
    Last edited by FornxXx; 09-15-2011 at 08:58 PM.

  5. #5
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    I'll help you with whatever it is, add x0riax@hotmail.com (I'm EST time zone)

  6. #6
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    I'll help you with whatever it is, add x0riax@hotmail.com (I'm EST time zone)
    added you mate i'll wait for you.

  7. #7
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Uhh, when I try to add someone it tells me that it can't be done right now, and I think people are unable to add me too, just pm me and try to include as much of what you need answered as you can

  8. #8
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    i think i got like only 10 done but i just posted the questions please help <3

  9. #9
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Re-read your textbook/notes. These are very basic questions which you should be able to answer.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  10. #10
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Code:
    1. D
    2. E
    3. D
    4. B
    5. -
    6. D? Just a guess
    7. A
    8. E
    9. C
    10. D
    11. E
    12. A
    13. C
    14. D
    15. B
    16. B
    17. C
    18. D
    19. E
    20. E
    21. E
    22. C (more accurate answer if you can give multiple choises: A & C -> compile and execute)
    23. E? Just a guess
    24. C
    25. D
    26. Go Laugh Out Loud
    Think Happy
    ^ notice that there are two lines.
    Heres my attempts, if anyone notices anything wrong, please tell me what and why
    There used to be something meaningful here.

  11. #11
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Updated the Quiz, Please Help!

    btw #17 - #23 are not multiple choice!

    and every multiple question can have more than one answer! <3

  12. #12
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Ok, I figured I'd give this a shot. It's been awhile since I've done C# so forgive me if a few are off.

    Code:
    1	Which of the following is a valid identifier?	
    C.	exampleOfAValue		
    
    2	The number 768 is an example of a ________type. 	
    B.	integer		
    
    3	Which of the following is a reference type?		
    C.	string	
    
    4	The character that cannot be used with an identifier is:	
    E.	all of the above	
    
    5	Which of the following is a reserved keyword?		
    C.	int	
    
    6	One of primary differences between float, double, and decimal is:	
    B.	double is normally used with large monetary values.		
    
    7	Which of the following is a valid declaration for a variable to store the name of this textbook?	
    D.	string bookName;	
    
    8	Types are implemented in C# using: 
    A.	classes			
    
    9	An object of the int class is:	
    B.	47		
    
    10	What would be an appropriate declaration for a variable to indicate whether a value has reached its upper limit? 
    C.	bool upperLimit;		
    
    11	Adding the keyword const to a declaration:	
    A.	places a value in memory that cannot be changed	
    
    12	Which statement increases the result by 15?		
    D.	result += 15;		
    
    13	What is stored in the variable ans as a result of the arithmetic expression, given the following declarations?
    int ans = 0, vl = 10, v2 = 19; 
    ans = --v2 % vl++;
    B.	9		
    
    14	What is stored in variable ans as a result of the arithmetic expression, given the following declarations?
    int ans = 10
    int vi = 5;
    int v2 = 7;
    int v3 = 18; 
    ans += vi + 10 * (v2-- / 5) + v3 / v2;
    B.	32		
    
    15	Which of the following formats the number 86 to display with two digits to the right of the decimal?		
    C.	{0:f2}	
    
    16	Check mark the expressions that are valid identifiers. If they are invalid, indicate why. 
    A.	intValue	./     	
    B.	value#l	    x - Invalid character 	
    C.	the first value	    	x - Spaces are not allowed
    D.	_value1	     	./
    E.	AVALUE	     	./
    
    17	For each of the following, code a variable decalaration using the best choice for data type	
    A.	a counter for the number of correct responses
    	- int counter;
    B	the amount of money you owe on a credit card 
    	- decimal moneyOwed;
    C	the name of your hometown 
    	- string hometownName;
    D	the grade you hope to obtain on the next exam 
    	- int grade;
    E	the letter grade you hope is recorded at the end of the term for this course 
    	- string letterGrade;
         	
    18	For each of the variable declarations in problem 18, add an appropriate compile-time initialization.	
    A.	counter for the number of correct responses begins with zero 
    	- int counter = 0;
    B	amount of money you owe on a credit card is zero	
    	- decimal moneyOwed = 0m;
    C	name of the hometown or the city where your school is located	
    	- string hometownName = "Mobile";
    D	grade on the next exam is 100	
    	- int grade = 100;
    E	grade to be recorded at the end of the term for this course is an A	
    	- string letterGrade = "A";
         	
    19	
    int x = 2;
    int y = 6;
    int z = 10;
    What will be value of each of these variables after each of the following statements is executed? (For each exercise, use the original declaration..	
    x	y	z	
    A.	z += ++y % 2;
    	- 11
    B.	x = y + 14 - z / 7;
    	- 18.57 // Error
    C.	x = y * z / 2 - x * z;	     	     	     	
    	- 10
    D.	x %= --z - y * 2;	  
    	- -1 // Error
    E.	y = (z - y) * 2 + --y;      	     	     	
    	- 13
    
    20	
    double x = 2.5;
    double y = 6.9;
    double z = 10.0;
    What will be value of each of these variables after each of the following statements is executed? (For each exercise, use the original declaration.	
    x	y	z	
    A.	z *= y++ % 7;
    	- 79
    B.	x = (int) y + (14 - z /7);	     	     	     	
    	- 19.57
    C.	x = z / 3 * --y;	     	     	     	
    	- 19.66
    D.	z /= (int) y / x;	     	     	     	
    	- 3.57
    E.	z = x + Y / 4;	     	     	     	
    	- 4.22
    
    21	What will be the output from each of the following statements?	
    A.	Console.Write("Result is {O:c}", 67);
    	- Result is $67.00
    B.	Console.Write("Number {O:fO} is {1:c}", 1,3);	     	
    	- Number 1 is $3.00
    C.	Console.Write("{O:fO}- {1:c}", 1,3 * 2);	     	
    	- 1-$6.00
    D.	Console.Write(" {O:fO} result" + "xyz {1:f2}", 1,25);	     	
    	- 1 resultxyz 25.00
    E.	Console.Write("This is the {O:fO}st example: {1:f2}", 1,3);	     	
    	- This is the 1st example: 3.00
    
    22	Explain how a variable differs from a constant.	
    A variable differs from a constant because they can change value after being declared. Constants are declared and can not be changed.
    
    
    23	Explain how type, class, and object are related to a string.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  13. #13
    Join Date
    Jun 2006
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just putting it out there - you should never store currency in a floating-point data type such as a double. In C#, currency would be stored in a decimal.

  14. #14
    Join Date
    Jan 2012
    Posts
    369
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Uhmm, wouldn't have google answered the same questions ?

  15. #15
    Join Date
    Dec 2011
    Location
    Sydney
    Posts
    1,284
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I once found a tool made by googled that answered any question you typed in. Can't seem to find it now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •