View Full Version : Need help with these questions

02-09-2007, 02:57 AM
I have some homework questions for my javascript class. Ive looked so hard for the answers in the book to no avail. So Here are the questions...If you could just answer as many as you can..even if its just one or 2 Id REALLY appreciate it

1. Which term represents the data type that consists of positive or negative numbers with no decimal places? Integer or Floating point??

2. Which statement is correct in reference to the following code?
var firstQuarter=new array();
a. Because element 0 was never assigned a value, this code is incorrect.
b. Element 0 will have a value of undefined.
c. The code is correct
d. This code forces element 0 to be deleted. It can not be assigned a value at a later date.
3. What are the operands in the following code segment?
count = 150;
a. count and 150
b. the equal sign (=)
c. count
d. 150
4. what will be the output from the following code segment?
var result;
var problem = 37 % 7;
document.write(‘<p> The value of result is “+ problem +”.</p>);
5. what is the value of this?
var x =1;
var y = ++1;
I think its 2..am I right??
6. what is the escape sequence for inserting a null character into a literal string??

7. all of the following choices are a valid return values for the typeof operator except (number, string, function, null)

8. what is the correct syntax to assign a numeric value to a variable??

9. when trying to perform a calculation with a nonnumeric operand, the javascript interpreter does what??

10. what does the JS interpreter look for to indicate the end of a string??

11. the lines that make up a function are called the what??

12. what is the correcnt syntax to declare a function called first_quarter with a parameter of months?

13. What is the code that invokes a function called?

14. a variable that is declared inside a function and is only available within the function in which it is declared is said to be …………… ?
15. what happens when a program contains a global and a local variable with the same name??

16. what is the value of returnValue in the following statement??

var returnValue = eval(“10 + 5”);
17. what is the value of returnValue in the following statement?
var returnValue=eval(“Good Morning”);

18. which of the following statements uses the correct syntax to display a confirm dialog box?
a. var confirmOrder(“Is your order correct?”):
b. var confirmOrder= [“Is your order correct?”];
c. var confirmOrder = (“Is your order correct?”);
d. var confirmOrder{“Is your order correct?”};
19. what happens when a matching label is found in a switch statement?

20. each repetition of a loop is called a ………….

21. which of the following uses the correct syntax to receive a value stored in totalCost? The value is being returned by a function named grandTotal into a variable named discountValue.
a. discountValue = grandTotal(totalcost);
b. discountValue=grandTotal;
c. discountValue = totalCost:
d. grandTotal(totalCost)=discount(value)

02-09-2007, 08:29 AM
You will not learn if we tell you the answers.

Are you allowed to use the examples on a computer to see the outputs?

You can google a lot of the questions.
Floating point + javascript (http://www.google.com/search?hl=en&rls=com.microsoft%3Aen-us&q=Floating+point+%2B+javascript&btnG=Search) etc

02-09-2007, 12:10 PM
Well I dont think you have looked, no offence but the very first question would be answered in the book for sure! in fact the question practicly tells you the answer

After looking again at the questions they would ALL be answered in the book, you need to read the questions and then look at select words, for example the third question asks what is the operand, so you know to look in the book for operands and there WILL be a list its as simple as matching a picture to a picture!!!!

Philip M
02-09-2007, 06:51 PM
I think it might be said that if you have attended a JavaScript class and yet are unable to answer these rather basic questions even with the assistance of a text book, then possibly you ought to consider moving over to some other course more in line with your capabilities.