📄 http:^^www.cs.wisc.edu^~milo^cs302^program0.html
字号:
Date: Mon, 11 Nov 1996 17:13:24 GMTServer: NCSA/1.5Content-type: text/htmlLast-modified: Fri, 06 Sep 1996 06:52:56 GMTContent-length: 4428<HTML><HEAD><TITLE>Program 0 - CS 302 Fall 1996 - Section 4</TITLE></HEAD><BODY><H1 ALIGN=CENTER> <!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><A HREF="http://www.cs.wisc.edu/~cs302">CS 302</A> Fall 1996 - <!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><A HREF="http://www.cs.wisc.edu/~milo/cs302.html">Section 4</A></H1> <H2 ALIGN=CENTER>Algebraic Language Programming in C++</H2><H4 ALIGN=CENTER>Instructor: <!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><A HREF="http://www.cs.wisc.edu/~milo">Milo M. Martin</A> (milo@cs.wisc.edu)</H4><hr><br><H1 ALIGN=CENTER>Program 0</H1><H3 ALIGN=CENTER>Due Wednesday, September 11, 1996</H3> <hr><br><B>Objective:</B> Program 0 is designed to give you practice editing,compiling, executing, modifying, and documenting a program. This programis not graded, but is required to receive a passing grade in the class. <P>Before doing this assignment you may want to somereview the help documents from the <!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><A HREF="http://www.cs.wisc.edu/~cs302">CS302 home page</A>, such as theintroduction to <!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><AHREF="http://www.cs.wisc.edu/~cs302/C++/Introduction/MSwindows.html">Microsoft Windows</A> and <!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><A HREF="http://www.cs.wisc.edu/~cs302/C++/Borland4.5/intro.html"> Borland C++</A>. <p>Do the following exercises:<UL> <LI> Create your program directories. To do this, start the <!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><A HREF= "http://www.cs.wisc.edu/~cs302/C++/Introduction/filemanager1.html">File Manager</A>, select the <B>Copy...</B> option from the <B>File</B> menu. In the next window enter the following in the ``From:'' field,"<TT>R:\PUBLIC\MILO\PROGRAMS</TT>", In the ``To:'' field, enter"<TT>U:\</TT>". <LI> Do problem 1-1, page 33 (chapter 1, problem 1): Enter and run theprogram from Display 1.8, on page 21 of the text. When entering theprogram, pay close attention to the indentation of the lines of theprogram. <LI> Do problem 1-2, page 33. <LI> The program as presented has no comments or other documentation. Add header documentation (comments at the top of a source file) whichcontains the program title and number, your name, section, instructor,etc. Any characters on a line after <TT>//</TT> is a comment, and wordsbetween <TT>/* */</TT> are also comments. This last kind of commentworks across multiple lines. <LI> Turn in the assignment following the guidelines given in <!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><A HREF= "http://www.cs.wisc.edu/~milo/cs302/turnin.html">Turning in Assignments</A>. </UL><H3>Borland C++ 4.5 Hints</H3>Start Borland C++ <B>4.5</B> which is found in the <B>CSApps</B> programgroup. Make sure you are using <B>4.5</B> instead of 4.0 -- your CSAppsprogram group may contain both. When you have Borland up and running,you want to first create a file to write your program in. You click on<B>File</B> in the left corner of the screen, and choose <B>New</B>within the menu that drops down. An empty box will appear on yourscreen; this is where you will write your program. You will want to saveyour programs often. The first time you save it, choose <B>Save as</B>within the <B>File</B> menu. Click on the folders in the box on theright so that you will be saving the file in <TT>"U:\PROGRAMS\PROG0"</TT>.For the name of the file, enter <TT>"PROG0.CPP"</TT>. The <TT>.CPP</TT>lets you know that it is a C++ source file. The second time you save,you can just choose <B>Save</B>, and it will be done automatically. Toaccess a file that you have previously saved to the disk, simply choose<B>Open</B> from the <B>File</B> menu, changing to the desired folder,and then selecting the file. <P>Once you have the program typed into the file window, and you have savedthe program in case something unsavory happens, then you just need topress the little lightening bolt button near the top of the screen. Yourprogram will be compiled, linked, and run. If you made a typingerror, chances are you will get a syntax error. Go back to the program,check your typing, and when the mistake is found, change it and run theprogram again. <P>When the program runs, it will create a window, and prompt you for theprogram input. When the program is done the word ``interactive'' appearsin the title bar. After the program finishes, you can close the window itcreated by double clicking on the upper-left corner of the window. <HR><ADDRESS> <!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><A HREF="http://www.cs.wisc.edu/~milo">Milo M. Martin</a> (<!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><A HREF="http://www.cs.wisc.edu/cgi-bin/finger?milo">milo</a>@<!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><A HREF="http://www.cs.wisc.edu">cs</a>.<!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><A HREF="http://www.wisc.edu">wisc.edu</a>)<br></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -