Write a program to remove unnecessary blanks from a text file. Your program should read the text file and copy it to ano

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a program to remove unnecessary blanks from a text file. Your program should read the text file and copy it to ano

Post by answerhappygod »

Write a program to remove unnecessary blanks from a text file.Your program should read the text file and copy it to another textfile, but whenever more than one blank occurs consecutively, onlyone blank should be copied to the second file. The second fileshould be identical to the first file, except that all consecutiveblanks have been replaced by a single blank. If the input file e.g.looked like this: What a beautiful day! I wish I was at the beach…The output file should look like this: What a beautiful day! I wishI was at the beach… NB: First plan your program on paper (usingyour computational thinking to do so). You have to submit your planfor your program as well as the actual program code, input andoutput files. Planning your program can take the form of aflowchart, pseudocode, or notes to guide you in the development ofthe program.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply