


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A problem to develop an algorithm that determines the largest of three numbers, providing steps to input the numbers and expressing the algorithm as a c++ program. It also includes instructions to compile and run the program, test it with various inputs, and submit the files for assessment.
Typology: Lab Reports
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Develop an algorithm that will determine the largest of three numbers; include steps to input the three numbers. What is an algorithm? - A detailed sequence of actions to perform to accomplish some task. Named after an Iranian mathematician, Al-Khawarizmi. Technically, an algorithm must reach a result after a finite number of steps, thus ruling out brute force search methods for certain problems, though some might claim that brute force search was also a valid (generic) algorithm. The term is also used loosely for any sequence of actions (which may or may not terminate). - From FOLDOC, http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=algorithm Express the algorithm as a C++ program. Implement your C++ program on paprika.umw.edu or another system on the CPSC LAN. Go to B13. Login in using your user name and password for the campus network Open a window on your desktop Use vi, vim, or the text editor tool to enter the source of your program. Save it in a file named largest.cpp. Compile the program and if the compilation is successful, put the run file in largest.R cpp largest.cpp -o largest.R If there are no errors or warnings then execute the program and capture the results in a script file. Enter the following script largest.R .. enter the three values exit recall that this creates a file named typescript, that contains everything that appeared in the current window. Remember that you have to enter exit to terminate the script. print the files named typescript and largest.cpp. (! Don't you dare try to print largest.R !) Turn in the hard copy of these files. lp largest.cpp typescript output is in B14.
Test the program using different types of inputs: all the numbers the same, all of the numbers negative, the last input a non-numeric character, the second input a non-numeric character, the first input a non-numeric character. Enter the following largest.R .. enter the three values for the first test largest.R .. enter the three values for the second test largest.R .. enter the three values for the third test largest.R .. enter the three values for the fourth test largest.R .. enter the three values for the fifth test exit While you're logged on to a system in B13, send me an email in which you describe the results of each of the tests. There are at least 2 email clients available on the systems that make up the CPSC LAN. They are elm and pine. When you use elm you'll use vi to compose a message, and when you use pine you'll use pico to compose a message. It's your choice; send me the email using either elm [email protected] or pine [email protected] for next class read Ch 1 p 1-38, Ch 2 p 43-
ir s t Second, set cache limit to 0.5 MB Third, clear cache