Question

Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that...

Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author's name, the title of the work, and a volume number in the form Volume 9 of 9. For example, a set of three volumes requires three labels: Volume 1 of 3, Volume 2 of 3, and Volume 3 of 3. Design an application that reads records that contain an author's name, the title of the work, and the number of volumes. The application must read the records until eof is encountered and produce enough labels for each work.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

datafile: data.txt

Output:

Code:

with open("data.txt") as f:    # opeaning file
   lines = f.readlines()   #   reading lines from file as a list. Each element in list is a line.
# this will read file till EOF

lines = [x.strip() for x in lines]   # removing leading and trailing spaces from lines

for line in lines:
   if(line == ''):
       continue   # to couter empty lines
   content = line.split(',')   # seperating Author Name, Title, Volume number and storing it in a list
   AuthName = content[0].strip()   # removing leading and trailing spaces from word
   Title = content[1].strip()       # removing leading and trailing spaces from word
   NoOfVol = int(content[2].strip())# removing leading and trailing spaces from word and converting to integer

   for i in range(1, NoOfVol+1):   # printing in desired format
       print("Author Name: {0} Title: {1} Volume: {2} of {3} ".format(AuthName, Title, i, NoOfVol))
       # loop to print all number of volumes .

Add a comment
Know the answer?
Add Answer to:
Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that...

    Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author’s name, the title of the work, and a volume number in the form Volume 9 of 9. For example, a set of three volumes requires three labels: Volume 1 of 3, Volume 2 of 3, and Volume 3 of 3. Design an application (Flowchart and Pseudocode) that reads records that contain an author’s name, the title of the work, and the...

  • If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but...

    If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...

  • accordingly answer and i pt): Polymers and Monomers. Read each question chemical structure, in a oymer chemical structure based on the polymer name and provide the monomer unit chemical st...

    accordingly answer and i pt): Polymers and Monomers. Read each question chemical structure, in a oymer chemical structure based on the polymer name and provide the monomer unit chemical structure, in addition. Lastly applications. An example answer is provided as guidance. , provide an example of how the polymers are utilized in (bio)engineering Polymer Chemical Structure Polymer Full Name and Abbreviation Usage Example for Monomer Unit Structure(s) _ _pt per box) pt per box) pt per box) Nucleic Acid (DNA)...

  • Program 7 Arrays: building and sorting (100 points) Due: Friday, October 30 by 11:59 PM Overview...

    Program 7 Arrays: building and sorting (100 points) Due: Friday, October 30 by 11:59 PM Overview For this assignment, write a program that will calculate the quiz average for a student in the CSCI 240 course. The student's quiz information will be needed for later processing, so it will be stored in an array. For the assignment, declare one array that will hold a maximum of 12 integer elements (ie. the quiz scores). It is recommended that this program be...

  • Solve it for java Question Remember: You will need to read this assignment many times to...

    Solve it for java Question Remember: You will need to read this assignment many times to understand all the details of the you need to write. program Goal: The purp0se of this assignment is to write a Java program that models an elevator, where the elevator itself is a stack of people on the elevator and people wait in queues on each floor to get on the elevator. Scenario: A hospital in a block of old buildings has a nearly-antique...

  • Program 7 File Processing and Arrays (100 points) Overview: For this assignment, write a program that...

    Program 7 File Processing and Arrays (100 points) Overview: For this assignment, write a program that will process monthly sales data for a small company. The data will be used to calculate total sales for each month in a year. The monthly sales totals will be needed for later processing, so it will be stored in an array. Basic Logic for main() Note: all of the functions mentioned in this logic are described below. Declare an array of 12 float/doubles...

  • Need answers. thank you VOCABULARY BUILDER Misspelled Words Find the words below that are misspelled; circle...

    Need answers. thank you VOCABULARY BUILDER Misspelled Words Find the words below that are misspelled; circle them, and then correctly spell them in the spaces provided. Then fill in the blanks below with the correct vocabulary terms from the following list. amino acids digestion clectrolytes nutrients antioxident nutrition basal metabolic rate extracellulare oxydation calories fat-soluble presearvatives catalist glycogen processed foods cellulose homeostasis saturated fats major mineral coenzyeme trace minerals diaretics metabolism water-soluable 1. Artificial flavors, colors, and commonly added to...

  • 10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated...

    10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...

  • Please show the formulas. Unique Sinks Master Budget Unique Sinks is a family-owned manufacturing business specializing...

    Please show the formulas. Unique Sinks Master Budget Unique Sinks is a family-owned manufacturing business specializing in sinks; it does not produce any of the faucets or plumbing needed for installation. The company focuses on the new housing market, which has been quite strong for over ten years. Unique Sinks' core competencies include a relatively low- cost but high-quality manufacturing process for sinks. During the last several years, demand for large houses with three to four bathrooms was strong. And...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT