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
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
 Spring '08
 Gottlieb
 Microeconomics

Click to edit the document details