{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Assignment 2 Outline

O m prints out the opening greeting calls

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: culates the net force on a post. In the table it prints either ‘Decreasing’ or ‘Increasing’ after each line indicating whether increases to chain length are increasing or decreasing the net force on a support. It determines and prints the chain length with the minimum net force observed. Finally it calls showTermination. • angleWithPost(aVal, hh, dd, numPoints): This function returns the chain length and the angle between the chain and the post [rad], based on dividing the chain into numPoints – 1 intervals using numPoints points, with the first being (- dd, hh) and the last being (dd, hh). It calls chainPoints to create the lists of x and y values, and chainLength to determine the overall length of the chain. It determines the angle with the post from the last interval of the chain, as in Equation (4). • chainLength(xs, ys): This function applies Equation (2) to find the length of the chain, given the x and y values of points along the chain. The parameters must be lists of the same length. • chainPoints(hh, dd, aa, numPoints): This function creates numPoints equally spaced x values between –dd and dd and puts them in a list. It creates numPoints y values by applying Equation(1) to the x values, and puts them in a list. It returns both lists. Hand- in You will hand in your program script file. Also hand in the output produced by your code that looks like the example above. You can select your output in the Canopy output window, then right- click and Copy (Raw Text) and paste it into a text file to submit. Question 3—Word Game [8 marks] Description Read in a list of English words. Randomly select a long word and show it to the contestant. Challenge the contestant to find shorter words using letters from the long word. They should type each one and press Enter. After 30 seconds, the game stops accepting entries. It evaluates the user’s submissions and finds which ones were valid words. It prints the final tally, and shows the words the user guessed correctly, and the invalid words the user submitted. Finally it shows all the valid words that could be made. COMP 1012 Winter 2014 Assignment 2 Page 7 of 9 Sample Output: WELCOME TO WORD TRIX We will show you a word, and you will enter other words with the same letters. They must ha...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online