0

hi all have a homework project have to come up with a html code for ducci's 4 number game using a fuction called difference(firstNumber secondNumber) can anyone help if i get this wrong i am in serious trouble please help

6
Contributors
10
Replies
11
Views
7 Years
Discussion Span
Last Post by rajendra.parmar
0

i dont want the answer i just need a little shoov in the right direction

0

Its not learning if your making someone else do it

i only need a shoov in the right direction can you help

0

you start, we steer - once you begin
There are announcements above all the forums about homework
just how PO everybody who will answer is about homework
show a code example, and many will help straight off, otherwise you just get answers like this

0

hi all this is what i have so far and its not working please help

<script>
var numberArray = [16,14,4,5];
var diffArray = new Array(4);
function difference(firstNumber, secondNumber,)
{
var firstNumber = numberArray.lenght;
var secondNumber = numberArray.lenght;
{
for (var count = 0; count < numberArray.length; count = count + 1)
{
diffArray[count] = firstNumber[count] - secondNumber[count + 1];
}

for (var count = 0; count < diffArray.length; count = numberArray + 1)
{
if (firstNumber > secondNumber)
{
firstNumber - secondNumber;
}
else
{
secondNumber - firstNumber;
}
}
{
document.write(difference() + ',');
}
}}
</SCRIPT>

0

Your code is full of syntax errors. I think this is what you want. But, you really need to learn this stuff on your own.

<script>
difference();
function difference() {
	var numberArray = [16,14,4,5];
	var diffArray = new Array(4);
	var count = 0;
	var numLen = numberArray.length;
	for (count = 0; count < numLen; count++) {
		if ((count + 1) == numLen) {
			diffArray[count] = numberArray[count] - numberArray[0];
			alert("a " +numberArray[count] + " - " + numberArray[0] + " = " + diffArray[count]);
		} else {
			diffArray[count] = numberArray[count] - numberArray[count + 1];
			alert("b " + numberArray[count] + " - " + numberArray[count + 1] + " = " + diffArray[count]);
		}
	}
}
</script>
0

You can't use this for your answer on TMA03 question 4 of the m150open uni course as it is using java that is not in the books yet!

0

im not at uni im only 15 still at school my teachures say i dont have the brains to go to uni

0

im not at uni im only 15 still at school my teachures say i dont have the brains to go to uni

Your using the same values as the question and the same function names. I'm not stupid so don't take me for a fool! Oh and in the other forum you are even showing the java with the same comments on it and date!

0

you can use html input object,


hi all have a homework project have to come up with a html code for ducci's 4 number game using a fuction called difference(firstNumber secondNumber) can anyone help if i get this wrong i am in serious trouble please help

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.