📄 page_753.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>page_753</title> <link rel="stylesheet" href="reset.css" type="text/css" media="all"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <table summary="top nav" border="0" width="100%"> <tr> <td align="left" width="30%" style="background: #EEF3E2"><a style="color: blue; font-size: 120%; font-weight: bold; text-decoration: none; font-family: verdana;" href="page_752.html">< previous page</a></td> <td align="center" width="40%" style="background: #EEF3E2"><strong style="color: #2F4F4F; font-size: 120%;">page_753</strong></td> <td align="right" width="30%" style="background: #EEF3E2"><a style="color: blue; font-size: 120%; font-weight: bold; text-decoration: none; font-family: verdana;" href="page_754.html">next page ></a></td> </tr> <tr> <td align="left" colspan="3" style="background: #ffffff; padding: 20px;"> <table border="0" width="100%" cellpadding="0"><tr><td align="center"> <table border="0" cellpadding="2" cellspacing="0" width="100%"><tr><td align="left"></td> <td align="right"></td> </tr></table></td></tr><tr><td align="left"><p></p><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="right"><font face="Times New Roman, Times, Serif" size="2" color="#FF0000">Page 753</font></td></tr></table><table border="0" cellspacing="0" cellpadding="0"><tr><td rowspan="5"></td> <td colspan="3" height="12"></td> <td rowspan="5"></td></tr><tr><td colspan="3"></td></tr><tr><td></td> <td><font face="Courier New, Courier, Mono New, Courier, Mono" size="2">//******************************************************************<br /><br />void聽Summarize(<br />聽聽/*聽in聽*/聽聽const聽TableType聽absenteeData,聽聽聽聽//聽Table聽of聽absences<br />聽聽/*聽out聽*/聽ChartType聽聽聽聽聽聽barChart聽聽聽聽聽)聽聽聽//聽Chart聽of聽percentages<br /><br />//聽Calculates聽total聽percentages聽by聽day聽and聽represents<br />//聽the聽results聽in聽a聽bar聽chart<br /><br />//聽Precondition:<br />//聽聽聽聽聽absenteeData[A..F][MONDAY..FRIDAY]聽are聽assigned<br />//聽Postcondition:<br />//聽聽聽聽聽For聽each聽day,聽the聽total聽number聽of聽absences聽over聽all<br />//聽聽聽聽聽departments聽has聽been聽computed聽as聽a聽percentage聽of聽total<br />//聽聽聽聽聽absences聽all聽week<br />//聽聽&&聽For聽all聽j,聽where聽MONDAY聽<=聽j聽<=聽FRIDAY,<br />//聽聽聽聽聽聽聽聽聽column聽j聽of聽barChart聽has聽been聽filled聽with聽the聽number聽of<br />//聽聽聽聽聽聽聽聽聽asterisks聽corresponding聽to聽day聽j's聽absence聽percentage,<br />//聽聽聽聽聽聽聽聽聽rounded聽to聽the聽nearest聽10聽percent<br /><br />{<br />聽聽聽聽DayType聽聽day;聽聽聽聽聽聽聽聽聽聽聽//聽Loop聽counter<br />聽聽聽聽DeptType聽dept;聽聽聽聽聽聽聽聽聽聽//聽Loop聽counter<br />聽聽聽聽float聽聽聽聽percent;聽聽聽聽聽聽聽//聽Daily聽percentage<br />聽聽聽聽int聽聽聽聽聽聽dailyTotal;聽聽聽聽//聽Total聽per聽day<br />聽聽聽聽int聽聽聽聽聽weeklyTotal;聽聽聽聽//聽Total聽of聽entire聽table<br /><br />聽聽聽聽weeklyTotal聽=聽TotalAbsences(absenteeData);<br />聽聽聽聽for聽(day聽=聽MONDAY;聽day聽<=聽FRIDAY;聽day聽=聽DayType聽(day聽+1))<br />聽聽聽聽{<br />聽聽聽聽聽聽聽dailyTotal聽=聽0;<br />聽聽聽聽聽聽聽for聽(dept聽=聽A;聽dept聽<=聽F;聽dept聽=聽DeptType聽(dept聽+1))<br />聽聽聽聽聽聽聽聽聽聽聽dailyTotal聽=聽dailyTotal聽+聽absenteeData[dept][day];<br />聽聽聽聽聽聽聽if聽(weeklyTotal聽>聽0)<br />聽聽聽聽聽聽聽聽聽聽聽percent聽=聽float(dailyTotal)聽/聽float聽(weeklyTotal)聽*聽100.0;<br />聽聽聽聽聽聽聽else<br />聽聽聽聽聽聽聽聽聽聽聽percent聽=聽0.0;<br />聽聽聽聽聽聽聽SetAsterisks聽(barChart,聽day,聽percent);<br />聽聽聽聽}<br />}<br /><br />//******************************************************************<br /></font></td><td></td></tr><tr><td colspan="3"></td></tr><tr><td colspan="3" height="1"></td></tr></table></td></tr></table><p><font size="0"></font></p>聽 </td> </tr> <tr> <td align="left" width="30%" style="background: #EEF3E2"><a style="color: blue; font-size: 120%; font-weight: bold; text-decoration: none; font-family: verdana;" href="page_752.html">< previous page</a></td> <td align="center" width="40%" style="background: #EEF3E2"><strong style="color: #2F4F4F; font-size: 120%;">page_753</strong></td> <td align="right" width="30%" style="background: #EEF3E2"><a style="color: blue; font-size: 120%; font-weight: bold; text-decoration: none; font-family: verdana;" href="page_754.html">next page ></a></td> </tr> </table> </body> </html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -