Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This one is python stuff and use Visual studio code! Module 6 - Problem Set No. 10 Problem 5 Learning to Write and Read IMPORTANT

image text in transcribedThis one is python stuff and use Visual studio code!

Module 6 - Problem Set No. 10 Problem 5 Learning to Write and Read IMPORTANT - PROVIDE AN IPO (Inputs, Processes, and Output) AT THE TOP OF EACH PROGRAM USING COMMENTS. Enter your name at the top of the program where it says YOUR NAME At the top of each program, including a section of comments that identifies all of the inputs, processes, and outputs for the program. Include comments within your code explaining what the code is doing. - You don't need to comment every line. You must use coding techniques covered in Chapters 1, 2, 3, 5, 6 and 7 in your solutions. Instructions Name your function main() Develop a program that asks the user how many sentences they want to enter Using a for loop and the number from the step above, ask a user to enter a sentence Write the sentence to a file named "mystuff.txt". Be sure to open the file for either write or append. Make sure to append a " " to the end of each sentence (line feed) Be sure to close the file once the loop has been completed. Once all of the sentences have been written to the file, open the file for read access "r". Using a loop, display all of the sentences one at a time. Be sure to strip off the line feed. Close the file Module 6 - Problem Set No. 10 Problem 5 Learning to Write and Read IMPORTANT - PROVIDE AN IPO (Inputs, Processes, and Output) AT THE TOP OF EACH PROGRAM USING COMMENTS. Enter your name at the top of the program where it says YOUR NAME At the top of each program, including a section of comments that identifies all of the inputs, processes, and outputs for the program. Include comments within your code explaining what the code is doing. - You don't need to comment every line. You must use coding techniques covered in Chapters 1, 2, 3, 5, 6 and 7 in your solutions. Instructions Name your function main() Develop a program that asks the user how many sentences they want to enter Using a for loop and the number from the step above, ask a user to enter a sentence Write the sentence to a file named "mystuff.txt". Be sure to open the file for either write or append. Make sure to append a " " to the end of each sentence (line feed) Be sure to close the file once the loop has been completed. Once all of the sentences have been written to the file, open the file for read access "r". Using a loop, display all of the sentences one at a time. Be sure to strip off the line feed. Close the file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sql All In One For Dummies 7 Books In One

Authors: Allen G Taylor ,Richard Blum

4th Edition

1394242298, 978-1394242290

More Books

Students also viewed these Databases questions

Question

Describe the tax rules governing the formation of corporations.

Answered: 1 week ago