Marketplace

Related Articles

More

Related Categories

Recently Added

More

Join StudyUp.com Today

It's always free and anyone can join!

Watch StudyUp Demo Video Now

You Recently Visited

Fourth Grade Writing Prompts

Edward Said:

cannot figure out where i am going wrong?

We Answered:

<script type="text/javascript"
<script type="text/javascript">

Barry Said:

Javascript Help!! Can someone do this?

We Answered:

bit confused by what you're wanting to do, but you might like this improved <script>

<script type="text/javascript">

Array.prototype.sum = function(){
return (! this.length) ? 0 : this.slice(1).sum() +
((typeof this[0] == 'number') ? this[0] : parseInt(this[0]));
};

Array.prototype.average = function(){
return (this.sum() / this.length);
};

var testScores = new Array();
testScores[0] = prompt('What was your first test score?','');
testScores[1] = prompt('What was your second test score?','');
testScores[2] = prompt('What was your third test score?','');
testScores[3] = prompt('What was your fourth test score?','');
testScores[4] = prompt('What was your fifth test score?','');
document.write('This is the Average of all your Test Scores: ' + testScores.average());

</script>

I used the Array.prototype to add the methods 'sum' and 'average' to the Array object. As long as you use arrays you can now do things like
testScores.sum() and it'll return the total of all the test scores
and
testScores.average() and it'll return the average of all the test scores

Edit: think i figured out what you wanted, if you use my script just do
var average = testScores.average();

Walter Said:

Easy C problem, but I'm confused?

We Answered:

Dude, I'm not going to do your homework, so I'll tell you a solution, instead.

1. Start the while loop asking for grade score or whatever you want to say, but also include an information stating that "exit" would take the user out of inputting more info.
2. Receive Input
3. Calculate, if input is not "exit" then start with the prompt from the while loop, if input is "exit, exit loop.
4. Display grade with message, or whatever

Sharon Said:

I want to know what's wrong with this javascript!?

We Answered:

Check this line ave=(parseFloat(a)+parseFloat(b)+pars...…


Seems as if a ) is missing.

What is the variable +pars....

Dianne Said:

COLLEGE ESSAY HELP....?

We Answered:

It definitely can be non-academic like, for example, a sports competition.
But I would suggest using a more recent example (i.e. middle school-high school).

I am a senior in HS as well and already finished my applications & essays, but this is from what my counselors/teachers told me last year.

Discuss It!