⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 page_891.html

📁 Programming and Problem Solving with C++
💻 HTML
📖 第 1 页 / 共 2 页
字号:
</tr><tr><td colspan="3"></td></tr><tr><td></td>  <td><font face="Times New Roman, Times, Serif" size="3">2. the first If condition is TRUE and the second is FALSE</font></td><td></td></tr><tr><td colspan="3"></td></tr><tr><td colspan="3" height="1"></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="Times New Roman, Times, Serif" size="3">3. the first If condition is TRUE, the second is TRUE, and the third is FALSE</font></td><td></td></tr><tr><td colspan="3"></td></tr><tr><td colspan="3" height="1"></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="Times New Roman, Times, Serif" size="3">4. the first If condition is TRUE, the second is TRUE, and the third is TRUE</font></td><td></td></tr><tr><td colspan="3"></td></tr><tr><td colspan="3" height="1"></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="Times New Roman, Times, Serif" size="3">Below is a table displaying values of </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">hrs</font><font face="Times New Roman, Times, Serif" size="3">, </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">mins</font><font face="Times New Roman, Times, Serif" size="3">, and </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">secs</font><font face="Times New Roman, Times, Serif" size="3"> that correspond to these four cases. For each case we also write down what we hope will be the values of the variables after executing the algorithm.</font></td><td></td></tr><tr><td colspan="3"></td></tr><tr><td colspan="3" height="1"></td></tr></table><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="12"></td></tr><tr><td><table cellspacing="0" width="480" cellpadding="7"><tr><td valign="top"></td><td colspan="3" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2"><i>Initial values</i></font></td></tr></table></td><td valign="top"></td><td colspan="3" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2"><i>Expected Results</i></font></td></tr></table></td><td valign="top"></td></tr><tr><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2"><i>Case</i></font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Courier New, Courier, Mono New, Courier, Mono" size="2">hrs</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Courier New, Courier, Mono New, Courier, Mono" size="2">mins</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Courier New, Courier, Mono New, Courier, Mono" size="2">secs</font></td></tr></table></td><td valign="top"></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Courier New, Courier, Mono New, Courier, Mono" size="2">hrs</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Courier New, Courier, Mono New, Courier, Mono" size="2">mins</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Courier New, Courier, Mono New, Courier, Mono" size="2">secs</font></td></tr></table></td><td valign="top"></td></tr><tr><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">1</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">10</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">5</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">30</font></td></tr></table></td><td valign="top"></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">10</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">5</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">31</font></td></tr></table></td><td valign="top"></td></tr><tr><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">2</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">4</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">6</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">59</font></td></tr></table></td><td valign="top"></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">4</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">7</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">0</font></td></tr></table></td><td valign="top"></td></tr><tr><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">3</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">13</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">59</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">59</font></td></tr></table></td><td valign="top"></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">14</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">0</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">0</font></td></tr></table></td><td valign="top"></td></tr><tr><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">4</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">23</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">59</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">59</font></td></tr></table></td><td valign="top"></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">0</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">0</font></td></tr></table></td><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><font face="Times New Roman, Times, Serif" size="2">0</font></td></tr></table></td><td valign="top"></td></tr></table></td></tr></table><br /><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="Times New Roman, Times, Serif" size="3">Using the initial values for each case, a hand trace confirms that the algorithm produces the desired results.</font></td><td></td></tr><tr><td colspan="3"></td></tr><tr><td colspan="3" height="1"></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="Times New Roman, Times, Serif" size="3">Finally, we write a test driver for the </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">Increment</font><font face="Times New Roman, Times, Serif" size="3"> function, just to be sure that our understanding of the algorithm logic is the same as the computer's! Here is a possible test driver:</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_890.html">&lt;&nbsp;previous page</a></td>				<td align="center" width="40%" style="background: #EEF3E2"><strong style="color: #2F4F4F; font-size: 120%;">page_891</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_892.html">next page&nbsp;&gt;</a></td>			</tr>		</table>		</body>	</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -