CORNELL CS 100 - Project 1: A Little Bit Of Everything

Unformatted text preview:

CS100 J & M Spring 2001Project 1: A Little Bit Of EverythingDue Tuesday 1/301. Objective2. Information and Policies3. MATLAB4. Java5. Algorithms6. Submitting Your WorkCS100 J & M Spring 2001Project 1: A Little Bit Of EverythingDue Tuesday 1/301. ObjectiveCompleting all tasks in this assignment will help you:• find information and understand policies in both CS100J and CS100M• learn the rudiments of editing files for programs• run your first Java and MATLAB programsFirst skim, and then, carefully read the entire assignment before starting any tasks!2. Information and PoliciesTopics: course policies and procedures, accessing CS100 webpages and newsgroups, editing text filesTasks:• Access either the CS100J or CS100M newsgroup.• Save the article with the subject line PROJECT 1 QUESTIONS to a file.• Edit the file with any text editor or word processor.• Write the following information at the top of the file:Name: your name Partner: partner’s nameID: your ID ID: partner’s IDSection: your section’s instructor,day,time Section: partner’s section’s instructor,day,timeDate: due dateProject: number and title• Skip a line, write Project 1: Part A, and skip another line.• Answer the questions inside this file by writing your responses after each question.• Be neat! Format the file following the course guidelines for e-mail and newsgroup posting.• Save your work as ASCII text if you used a word processor.• Print your file.3. MATLABTopics: setting your path in the MATLAB command window, using MATLAB’s help function, generating a plot ofdataTasks:Assume that you are conducting an experiment that involves measuring how far a spring will stretch (deflection,centimeters) for various weights (Newtons). Suppose you have collected the following data:Write a MATLAB script called p1PartB.m that plots this data. You will fill in missing portions of the code,including a prediction of a reasonable deflection for a weight of 75N. Print out the completed code and figure.Test1234567891011Weight (N)0 102030405060708090100Deflection (cm)0 0.7 2.2 2.9 4.1 4.8 5.9 7.0 8.3 9.1 9.94. JavaTopics: downloading files, running code, editing program, experimenting, debugging, printing a windowTasks:From either CS100 website, download the file called p1PartC.java from the Projects page. Run the code. Youwill see a window with three “snowpersons” in the order red, green, blue. Also, the middle snowperson is missingarms. Rewrite the program such that the snowpersons will appear in the order blue, red, green and so that the middlesnowperson has arms. Print out the revised code and the window (or screen snapshot).5. AlgorithmsTopics: problem solving, algorithms, pseudocodeBackground:Programming is sometimes referred to as automating problem solving. A program “tells” a computer the steps tofollow in a language that the computer “understands.” But, the programmer must first devise those steps in aalgorithm, which is a “recipe” for the problem in question. An algorithm is composed of a sequence of steps thatsomeone (or something) would follow. For each task, below:• Create a new text file with the following information at the top of the file:Name: your name Partner: partner’s nameID: your ID ID: partner’s IDSection: your section’s instructor,day,time Section: partner’s section’s instructor,day,timeDate: due dateProject: number and title• Skip a line, write Project 1: Part D, Task (either 1 or 2), and skip another line.• Do the task and print out the file.Task 1:Using 1-2 pages of single-spaced, 12-point fixed-width font, write an algorithm that a robot would follow to tie yourshoe laces. Complete steps should read as a sentence and end with punctuation. To make your algorithm clear, indentsteps that are substeps of other instructions. When you need to make choices or repeat tasks, indent those steps. Forinstance,Find matching shoes.While matching shoes not foundSearch closet for 1st shoe.Search closet for 2nd shoe.While 1st shoe not equal 2nd shoe and shoe-pile not exhaustedPick another 2nd shoe.Bring shoes to human owner....Task 2:Using at most 1 page of single-spaced, 12-point fixed-width font, write an algorithm that the course instructor coulduse in lecture to find the most common birthday (e.g. “50 students share February 28 as their birthday”). Althoughnow the algorithm is for a human, not a computer, you should still strive for clarity and precision. Also, try to makeyour algorithm efficient by reducing unnecessary or “expensive” computations.6. Submitting Your WorkFollow the submission guidelines stated on the Projects page for either CS100J or


View Full Document

CORNELL CS 100 - Project 1: A Little Bit Of Everything

Download Project 1: A Little Bit Of Everything
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Project 1: A Little Bit Of Everything and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Project 1: A Little Bit Of Everything 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?