Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Javascript 5 points: Declare and instantiate an array containing at least 5 numbers. NOTE: this can just be hard - coded, you don't need

In Javascript 5 points: Declare and instantiate an array containing at least 5 numbers. NOTE: this can just be hard-coded, you don't need to prompt users for this array.
5 points: Write the last number in the array to the element with class lastNum
5 points: Write the contents of the array to the HTML element with the class numArray
10 points: Loop through this array using a for loop, adding each value to a variable named sum
5 points: Write sum to the element with class numSum
10 points: Use the proper conditional structure to write to the element with class sumDescription:
If the sum is less than 20, write "small"
Otherwise, if the sum is between 20 and 100(inclusive), write "medium"
Otherwise, write "large"
5 points: Declare two empty arrays named foods1 and foods2
10 points: Do the following until the user enters quit (hint: you have to do this at least once):
Gather input with this popup prompt: let input = prompt("Enter a food, or "quit" to stop.");
If the user didn't enter quit, append this string to the array foods1
5 points: Write the contents of the foods1 array to the HTML element with the class foods1Array
5 points: Write true or false to the HTML element with the class appleSearch, based on whether the foods array contains "apple"
15 points: While the foods1 array still has values (length >0), do the following:
Remove the current first value in foods1
Append this value to the end of foods2
5 points: Write the following to the specified HTML elements:
Contents of foods1 to the element with class finalFoods1
Contents of foods2 to the element with class finalFoods25 points: Declare and instantiate an array containing at least 5 numbers. NOTE: this can just
be hard-coded, you don't need to prompt users for this array.
5 points: Write the last number in the array to the element with class lastNum
5 points: Write the contents of the array to the HTML element with the class numArray
10 points: Loop through this array using a for loop, adding each value to a variable
named sum
5 points: Write sum to the element with class numSum
10 points: Use the proper conditional structure to write to the element with
class sumDescription:
If the sum is less than 20, write "small"
Otherwise, if the sum is between 20 and 100(inclusive), write "medium"
Otherwise, write "large"
5 points: Declare two empty arrays named foods 1 and foods 2
10 points: Do the following until the user enters quit (hint: you have to do this at least once):
Gather input with this popup prompt: let input = prompt("Enter a food, or "quit" to stop.");
If the user didn't enter quit, append this string to the array foods1
5 points: Write the contents of the foods 1 array to the HTML element with the
class foods1Array
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago