AJAX | JavaScript | HTML | PHP Answers

Questions: 323

Answers by our Experts: 213

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

line 9 /*
line 10 * Program designed to find how many of a series of video tracks
line 11 * will fit on a DVD the user is prompted to input the track lengths
line 12 * one by one. When the total exceeds the capacity of the disk
line13 * user is informed how many tracks this took
line 14 */
line 15 var input;
line 16 var total;
line 17 var capacity;
line 18 var count;
line 19 total = 0;
line 20 capacity = 120
line 21 count = 0;
line 22
line 23 input = window.prompt
line 24 (‘please enter a track length in minutes’,’’);
line 25 input = parsefloat(input);
line 26 total = total + input;
line 27 while (total<=capacity)
line 28 {
line 29 document.write(‘track length ‘ + input + ‘<BR>’)
line 30 count = count + 1;
line 31 input = window.prompt
line 32 (‘please enter a track length in minutes’,’’);
line 33 input = parsefloat(input);
line 34 total = total + input;
line 35 }
line 36 document.writ
line 37 (‘ the capacity was exceeded after ‘ + count + ‘ track(s) . ‘);


(a) Lines 9 to 14 in Figure 1 are an example of an extended comment. What is the purpose of comments and how are they treated by the JavaScript interpreter?
(b) What do lines 25 and 33 do and what difference would it make if they were left out?
(c) Describe in detail what happens when the statement
document.write('Track length ' + input + '<BR>');
at line 29 is executed.

(d) Suppose the programmer accidentally missed out line 30. Explain what would be output in that case when the statement on lines 36 and 37 was executed.
(e) If the programmer also missed out line 21 (so that both lines 21 and 30 are missing) what would then be output when the statement on lines 36 and 37 was executed? Explain your answer.
(f) Suppose the braces {and } at lines 28 and 35 were left out. Explain what would happen if the program was executed and the user entered 10 when prompted.
Suppose variables are declared and initialised as follows:

var firstArray = ['I','V','X','L','C','D','M'];
var secondArray = [1,5,10,50,100,500,1000];
var myString = 'INVICTUS';

Write down the value of each of the following????

(a) firstArray[2]
(b) firstArray.length
(c) The index of 'M'in firstArray
(d) The index of the first element in secondArray
(e) firstArray.length == myString.length
(f) firstArray[secondArray[1]]
(g) firstArray[2] < firstArray[6]
(h) myString.charAt(3) == firstArray[0]
(i) myString.charAt(myString.indexOf('S'))
(j) myString.indexOf(firstArray[3])
I want to rule the world!
I have developed an inquiry form in my website and sending the data to my email account but, when I am pressing the submit button I am getting the below error:


Deprecated: Assigning the return value of new by reference is deprecated in D:\xampp\php\PEAR\Mail.php on line 154

can you please help me.
Write a program to read the following numbers, round them off to the nearest integers and print out the
results in integer form:
29.55 50.32 101.97 -35.45 -219.62
Hey I'm just wondering when I run my program it shows theres something wrong with one of my method "turn":
Method:
public void turn()
{
Move move = ui.nextMove();
if (move == Move.LEFT || move == Move.RIGHT)
{
player.move(move.dx);
if (player.isAlive() && exit.found(player) && itemsCollected())
exit.take();
}
else if (move == Move.DOWN)
{
for (int i=0;i<items.length;i++)
player.pickup(items[i]);
}

for (int i=0;i<enemies.length;i++)
enemies[i].attack(player);

}

The results of the program comes out with:

Your move (l/r/p): l
>
> java.lang.NullPointerException
> at Game.turn(Game.java:123)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Metho
> at

PLEASE HELP ASAP =)
Help me with there sentence combining exercises about fragments into one sentence.

for example: 1. I always order cheese fries. The reason why is because they're my favorite.



2. My parents gave me a car. That is why I'm able to afford to go to college.

Still, I work part- time. I work at Wal-mark. I'm a cashier.


please help me with this two sentence combined in one


thanks, jesus
I am working on a homework assignment for web scripting and the book I am working out of is called "JavaScript and Ajax, 2nd edition." I am having so much trouble trying to get a scrolling marquee to work.
Well I am making a program with greenfoot in java. I am trying to make a program that has birds following another birds. And I control the lead bird.
Anyone knows how to convert XML files into ini ?? (is there any converter?)

Ive heard that there is a converter that converts ini files into XML, but i havent found any that converts from XML into ini.. (yes ive tried the ini to xml converter if it works otherway but it doesnt)

Regards,
Edward
LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS