Exam 2 Sample

Exam 2 Sample - No Yes Average = total / count End Output,...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: No Yes Average = total / count End Output, sum, t otal and average Continue? Ask t o continue Count er++ Total = total + input Ask for input t otal=0 Count er=0 Star t EXAM 2 Example Questions Logic A = I ate potatos B = I ate beans A->~B = If I ate potatoes then I did not eat beans A ^ B = I ate potatoes and I ate beans I did not eat potatos and I ate beans = ~A ^ B I ate beans or I did not eat potatos = B v ~A Fill in the code Given a variable x , if x equals 10 output thats great number otherwise output not so great, but ok if (x==10) { alert("that's a great number"); } else { alert("not so great, but ok"); } Given a variable count Write a loop that outputs the numbers 1 to count on separate lines in bold var mycounter=1; while (mycounter <=count) { document.write(<b> + mycounter + </b><br/>); mycounter++; } Value T racing var a = 1; var b = 3; var z = 12; while (a<b) { a+=2; z--; } What does z equal?...
View Full Document

Page1 / 5

Exam 2 Sample - No Yes Average = total / count End Output,...

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

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