[Solved] CS160 Lab 4 Formatting and File I/O

$25

File Name: CS160_Lab_4_Formatting_and_File_I_O.zip
File Size: 329.7 KB

SKU: [Solved] CS160 Lab 4 Formatting and File I/O Category: Tag:
5/5 - (1 vote)

Create a file named chaos.py that solves Programming Exercise 11 on pp. 163-164 with the change that instead of printing to the screen, it sends the output to a file named output.txt. Your program must ask you to enter two numbers (between 0 and 1) separated by a comma (i.e., use one input function call) and then the table output must be sent to the file output.txt and match the sample formatting exactly as it is in the book. Count the dashes (they are minus signs, not underscores in your output) and have everything line up at the same columns as it does. Below is a same run.

enter x1 and x2 separated by a comma: 0.34, 0.35

And then the file output.txt contains:

index 0.34 0.35-1 0.875160 0.8872502 0.426094 0.3901463 0.953698 0.9279354 0.172216 0.2607995 0.555976 0.7518536 0.962780 0.7276247 0.139755 0.7729318 0.468872 0.6844849 0.971221 0.84226610 0.109008 0.518130

Create a file named acronym.py that solves Programming Exercise 10 on p. 198. You must have a main function that calls the acronym function. Your acronym function must take as one parameter the string and return a string which is the acronym for the string that is passed as the parameter. Your acronym function must not have any input or print function calls. Below is a sample run.

enter phrase: random access memory RAM

Each file should have a function named main with all the code and then call the main function at the bottom of the file. Follow the style of my solutions to the previous labs. Review the lab grading rubric on iLearn to make certain you meet all the specifications.

Remember to put your name, course, and time in comments at the top of each file and comment your code. Using Capitals webmail, email me a message with the subject CS160-1ATT for 1PM or CS160-2ATT for 2PM with your chaos.py, acronym.py, and help.txt files attached.

1

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS160 Lab 4 Formatting and File I/O[Solved] CS160 Lab 4 Formatting and File I/O
$25