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

📄 page_246.html

📁 Programming and Problem Solving with C++
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">	<html>		<head>			<title>page_246</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_245.html">&lt;&nbsp;previous page</a></td>				<td align="center" width="40%" style="background: #EEF3E2"><strong style="color: #2F4F4F; font-size: 120%;">page_246</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_247.html">next page&nbsp;&gt;</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 246</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="Times New Roman, Times, Serif" size="3">12. The nested If structure below has five possible branches depending on the values read into </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">char</font><font face="Times New Roman, Times, Serif" size="3"> variables </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch1</font><font face="Times New Roman, Times, Serif" size="3">, </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch2</font><font face="Times New Roman, Times, Serif" size="3">, and </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch3</font><font face="Times New Roman, Times, Serif" size="3">. To test the structure, you need five sets of data, each set using a different branch. Create the five test data sets.</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"><img src="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" border="0" width="24" height="1" alt="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" /></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">cin聽&gt;&gt;聽ch1聽&gt;&gt;聽ch2聽&gt;&gt;聽ch3;<br />if聽(ch1聽==聽ch2)<br />聽聽聽聽if聽(ch2聽==聽ch3)<br />聽聽聽聽聽聽聽聽cout聽&lt;&lt;聽All聽initials聽are聽the聽same.聽&lt;&lt;聽endl;<br />聽聽聽聽else<br />聽聽聽聽聽聽聽聽cout聽&lt;&lt;聽First聽two聽are聽the聽same.聽&lt;&lt;聽endl;<br />else聽if聽(ch2聽==聽ch3)<br />聽聽聽聽cout聽&lt;&lt;聽Last聽two聽are聽the聽same.聽&lt;&lt;聽endl;<br />else聽if聽(ch1聽==聽ch3)<br />聽聽聽聽cout聽&lt;&lt;聽First聽and聽last聽are聽the聽same.聽&lt;&lt;聽endl;<br />else<br />聽聽聽聽cout聽&lt;&lt;聽All聽initials聽are聽different.聽&lt;&lt;聽endl;</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"><img src="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" border="0" width="29" height="1" alt="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" /></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">a. Test data set 1: </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch1</font><font face="Times New Roman, Times, Serif" size="3"> =____ </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch2</font><font face="Times New Roman, Times, Serif" size="3"> =_____ </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch3</font><font face="Times New Roman, Times, Serif" size="3"> =_____</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"><img src="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" border="0" width="29" height="1" alt="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" /></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">b. Test data set 2: </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch1</font><font face="Times New Roman, Times, Serif" size="3"> =_____ </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch2</font><font face="Times New Roman, Times, Serif" size="3"> =_____ </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch3</font><font face="Times New Roman, Times, Serif" size="3"> =_____</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"><img src="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" border="0" width="29" height="1" alt="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" /></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">c. Test data set 3: </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch1</font><font face="Times New Roman, Times, Serif" size="3"> =_____ </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch2</font><font face="Times New Roman, Times, Serif" size="3"> =_____ </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch3</font><font face="Times New Roman, Times, Serif" size="3"> =_____</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"><img src="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" border="0" width="29" height="1" alt="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" /></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">d. Test data set 4: </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch1</font><font face="Times New Roman, Times, Serif" size="3"> =_____ </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch2</font><font face="Times New Roman, Times, Serif" size="3"> =_____ </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch3</font><font face="Times New Roman, Times, Serif" size="3"> =_____</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"><img src="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" border="0" width="29" height="1" alt="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" /></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">e. Test data set 5: </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch1</font><font face="Times New Roman, Times, Serif" size="3"> =_____ </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch2</font><font face="Times New Roman, Times, Serif" size="3"> =_____ </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">ch3</font><font face="Times New Roman, Times, Serif" size="3"> =_____</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">13. If </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">x</font><font face="Times New Roman, Times, Serif" size="3"> and </font><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">y</font><font face="Times New Roman, Times, Serif" size="3"> are Boolean variables, do the following two expressions test the same condition?</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"><img src="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" border="0" width="24" height="1" alt="3e26ecb1b6ac508ae10a0e39d2fb98b2.gif" /></td>  <td colspan="3" height="12"></td>  <td rowspan="5"></td></tr><tr><td colspan="3"></td></tr><tr><td></td>

⌨️ 快捷键说明

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