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

📄 page_303.html

📁 Programming and Problem Solving with C++
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">	<html>		<head>			<title>page_303</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_302.html">&lt;&nbsp;previous page</a></td>				<td align="center" width="40%" style="background: #EEF3E2"><strong style="color: #2F4F4F; font-size: 120%;">page_303</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_304.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 303</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">Here is the program:</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="Courier New, Courier, Mono New, Courier, Mono" size="2">//******************************************************************<br />//聽Invoice聽program<br />//聽This聽program聽prints聽a聽shipping聽invoice聽given聽quantities,<br />//聽item聽descriptions,聽and聽unit聽prices聽as聽read聽from聽a聽data聽file<br />//******************************************************************<br />#include聽&lt;iostream.h&gt;<br />#include聽&lt;iomanip.h&gt;聽聽聽//聽For聽setw()聽and聽setprecision()<br />#include聽&lt;fstream.h&gt;聽聽聽//聽For聽file聽I/O<br /><br />const聽int聽DESCR_LENGTH聽=聽30;聽聽聽聽//Characters聽in聽an聽item聽description<br /><br />int聽main()<br />{<br />聽聽聽聽int聽聽聽聽聽聽quantity;聽聽聽聽聽聽聽聽//Number聽of聽items聽ordered<br />聽聽聽聽int聽聽聽聽聽聽totalUnits;聽聽聽聽聽聽//Total聽items聽in聽invoice<br />聽聽聽聽int聽聽聽聽聽聽counter;聽聽聽聽聽聽聽聽聽//聽Loop聽control聽variable聽for聽printing<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽//聽description<br />聽聽聽聽float聽聽聽聽price;聽聽聽聽聽聽聽聽聽聽聽//聽Unit聽price聽for聽an聽item<br />聽聽聽聽float聽聽聽聽amount;聽聽聽聽聽聽聽聽聽聽//Amount聽for聽quantity聽of聽items<br />聽聽聽聽float聽聽聽聽totalAmount;聽聽聽聽聽//Total聽amount聽of聽ivoice<br />聽聽聽聽char聽聽聽聽聽blank;聽聽聽聽聽聽聽聽聽聽聽//Dummy聽variable聽to聽hold聽blanks<br />聽聽聽聽char聽聽聽聽聽inputChar;聽聽聽聽聽聽聽//聽Holds聽聽one聽character聽of聽description<br />聽聽聽聽if聽stream聽inFile;聽聽聽聽聽聽聽聽聽//File聽containing聽item聽quantities,<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽//聽descriptions,聽and聽prices<br /><br />聽聽聽聽cout.setf(ios::fixed,ios::floatfield);聽聽//Set聽up聽floating聽pt.<br />聽聽聽聽cout.setf(ios::showpoint);聽聽聽聽聽聽聽聽聽聽聽聽聽聽//聽聽output聽format<br />聽聽聽聽cout聽&lt;&lt;聽setprecision(2);<br /><br />聽聽聽聽//聽Print聽headings<br /><br />聽聽聽聽cout聽&lt;&lt;聽setw(50)聽&lt;&lt;聽Mill聽Hollow聽Boring聽and聽Bearing聽Company<br />聽聽聽聽聽聽聽聽聽&lt;endl;<br />聽聽聽聽cout聽&lt;&lt;聽setw(43)聽&lt;&lt;聽128聽East聽Southwest聽Street聽&lt;&lt;聽endl;<br />聽聽聽聽cout聽&lt;&lt;聽setw(50)聽&lt;&lt;聽North聽Old聽Newgate,聽New聽Hampshire聽01010<br />聽聽聽聽聽聽聽聽聽&lt;聽endl;<br />聽聽聽聽cout聽&lt;&lt;聽endl;<br />聽聽聽聽cout聽&lt;&lt;聽setw(38)聽&lt;&lt;聽Shipping聽Invoice聽&lt;&lt;聽endl;<br />聽聽聽聽cout聽&lt;&lt;聽endl;<br />聽聽聽聽cout聽&lt;&lt;聽Quantity聽&lt;&lt;聽setw(22)聽&lt;&lt;聽Description<br />聽聽聽聽聽聽聽聽聽&lt;聽setw(19)聽&lt;聽Price聽&lt;聽setw(11)聽&lt;聽Amount聽&lt;聽endl;<br />聽聽聽聽cout聽&lt;&lt;聽endl;<br /><br />聽聽聽聽//聽Print聽body聽of聽invoice</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_302.html">&lt;&nbsp;previous page</a></td>				<td align="center" width="40%" style="background: #EEF3E2"><strong style="color: #2F4F4F; font-size: 120%;">page_303</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_304.html">next page&nbsp;&gt;</a></td>			</tr>		</table>		</body>	</html>

⌨️ 快捷键说明

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