3) { return $responses[2]; } } /* function creates survey form */ function writeSurvey() { global $questions; print('
'); echo '
Each month, the Conference Board sends this survey to 5,000 households to gauge consumer confidence in the U.S. economy. See how your answers fare against the May 2001 results.
'; $i = 0; for ($i; $i'; echo ''; /* chooses proper response set response */ $responses = responseswitch($i); print("\n\t\t"); printf(' %s: %s

', $i+1, $questions[$i]); $j = 0; for ($j; $j%s:   ', $responses[$j], $i, $j); } print("

"); echo ''; } print('

'); echo '

If you would like to see the results without submitting your responses, please click here.

'; } /* calculates percentage of each NewsHour response per question */ function newshourresponses ($question, $id) { global $db; global $totalcount; /* chooses proper response set response */ $responses = responseswitch($question); /* retrieves user's responses from database table */ if ($id != 0) { $sql = "SELECT id, question"; $sql .= $question+1; $sql .= " AS question FROM consumerconfidence WHERE id='$id'"; $result = mysql_query($sql, $db); echo mysql_error(); } $str = ''; $i = 0; for ($i; $i'; $str .= ''; } $str .= '
'; return $str; } /* Returns actual consumer confidence percentages*/ function actualresponses($question) { /* chooses proper response set response */ $responses = responseswitch($question); $actualnumbers = array ( array(31, 57, 12), array(39, 46, 15), array(17, 70, 13), array(14, 66, 20), array(25, 68, 7)); $currentnumbers = $actualnumbers[$question]; $str = ''; $i = 0; for ($i; $i'; $str .= ''; } $str .= '
'; return $str; } /* reports out NewsHour respondents results next to actual numbers */ function report($id) { global $db; global $questions; /* builds report table for each question */ $i = 0; for ($i; $i'; printf('%s: %s', $i+1, $questions[$i]); print('NewsHour ResultsActual Results*'); print(''); echo newshourresponses($i, $id); print(''); echo actualresponses ($i); print(''); echo ''; } echo '

* Actual results from May 2001 Conference Board survey.

'; echo '

If you have not participated in this survey and have not already submitted responses, please click here.

'; } ?> Online NewsHour -- Consumer Confidence, May 2001 "; ?>

a NewsHour with Jim Lehrer Transcript
Online NewsHour
Consumer Confidence
   

Consumer Confidence
Update: Results from the online poll of NewsHour viewers. (6/5/01)

Paul Solman reports on who crunches the numbers and what they mean. (5/29/01)

Confidence Down, Spending Up
Ray Suarez leads a discussion on the recent drop in consumer confidence. (4/30/01)

Interest Rate Cut
The Federal Reserve cuts a key interest rate, citing concerns over corporate profits and consumer confidence. (4/18/01)

Unemployment Up
Unemployment climbs to its highest rate in 20 months. (4/6/01)

Economic Downturn
Economists discuss the recent economic slowdown. (3/13/01)