JS Short Answers

JS Short Answers - CS170:SampleShortCoding KristianStout

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 170:  Sample Short Coding Kristian Stout stouty@rci.rutgers.edu
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Instructions Use the space provided under each question  to record your answers. You only need to  write the requested code -- you do not need to  provide the HTML, SCRIPT or any other tags if  the question does not ask for them.
Background image of page 2
Sample Question 1 Sample Question 1 (3 points) Given a variable called  flavor , use a single  if-statement to determine the following:  if the flavor entered was chocolate, print onto screen  “That is yummy” otherwise print onto screen “I am sure that’s ok too”   You can assume that any variables are already declared  and have values.  
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sample Question 2 (8 points) Create a variable called  total.  Ask a user to  enter a number and assign the result of to the  total   variable. Create a variable called  evenNumber  and  assign it the value of 0. Use a for-loop that starts at 0 
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/21/2012 for the course 198 170 taught by Professor Kristianstout during the Fall '10 term at Rutgers.

Page1 / 5

JS Short Answers - CS170:SampleShortCoding KristianStout

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online