Exam 2 Sample

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

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

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

View Full Document
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-&gt;~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(&quot;that's a great number&quot;); } else { alert(&quot;not so great, but ok&quot;); } Given a variable count Write a loop that outputs the numbers 1 to count on separate lines in bold var mycounter=1; while (mycounter &lt;=count) { document.write(&lt;b&gt; + mycounter + &lt;/b&gt;&lt;br/&gt;); mycounter++; } Value T racing var a = 1; var b = 3; var z = 12; while (a&lt;b) { a+=2; z--; } What does z equal?...
View Full Document

## 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
Ask a homework question - tutors are online