1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jolli1 [7]
3 years ago
14

2. Write a standalone function partyVolume() that takes accepts one argument, a string containing the name of a file. The object

ive of the function is to determine the a Volume object that is the result of many people at a party turning the Volume up and down. More specifically:
Computers and Technology
1 answer:
laiz [17]3 years ago
8 0

Answer:

The Python code is given below with appropriate comments

Explanation:

#required method, assuming Volume class is defined and is accessible

def partyVolume(filename):

   #opening file in read mode, assuming file exists

   file=open(filename,'r')

   #reading initial volume

   initial=float(file.readline())

   #creating a Volume object with initial volume

   v=Volume(initial)

   #looping through rest of the lines in file

   for line in file.readlines():

       #removing trailing/leading white spaces/newlines and splitting line by white

       #space to get a list of tokens

       line=line.strip().split(' ')

       #ensuring that length of resultant list is 2

       if len(line)==2:

           #reading first value as direction (U or D)

           dir=line[0].upper()

           #reading second value as float value

           value=float(line[1])

           if dir=='U':

               #turning volume up

               v.up(value)

           elif dir=='D':

               #turning volume down

               v.down(value)

   #closing file, saving changes

   file.close()

   #returning volume

   return v

You might be interested in
What is collaboration software?
LenKa [72]
<span>I'm not sure but I do know Collaboration means working together toward a mutual goal. so I hope that helps at least a little </span>
7 0
3 years ago
Read 2 more answers
15. Virus cannot infect files that are saved in i. USB ii. CD-ROMs iii. Memory card iv. All of them​
kramer

Answer:

all of them

Explanation:

but Virus can infect them if u plug them in infected computer .

7 0
3 years ago
Read 2 more answers
Which examples demonstrate common education and qualifications for Manufacturing Production Process Development careers? Check a
Tom [10]

Answer:

The answer is D "Latisha is a Mechanical Engineer with a bachelor's degree"

Explanation:

Workers in Manufacturing Production Process Development are liable for designing plan and plan of the manufacturing process. They work with clients to guarantee the manufacturing process delivers an item that meets or surpasses client expectations. Manufacturing Production Process Development is one of the many career paths in the Manufacturing Industry. Laborers in this Profession Way are liable for fundamental item plans and the plan of the manufacturing process itself. They should reliably draw in with their client to guarantee they produce an item that precisely coordinates their client's necessities. Occupations in this Profession Way incorporate Electrical and Electronic Drafters, Modern Designing Technologists, Assembling Creation Professionals, and Atomic Checking Specialists.

3 0
3 years ago
Read 2 more answers
What purpose does the underlined portion of this excerpt
Rudiy27

Answer:

The below mentioned portion is missing from the question

<em>A part of the sacrifice means the payment of more money in taxes. In my Budget Message I shall recommend that a greater portion of this great defense program be paid for from taxation than we are paying today. No person should try, or be allowed, to get rich out of this program; and the principle of tax payments in accordance with ability to pay should be constantly before our eyes to guide our legislation. </em>

<em />

The passage provides the reason why extra taxes must be collected should America decide to join the war  or it introduces the claim that patriotic Americans should be willing to sacrifice and pay extra taxes.

3 0
4 years ago
Do you remember your first 3D movie experience? What was the movie, what was the experience like, and why was it memorable? (If
maria [59]

Answer:

I went to my first 3d movie when I was 12. I remember thinking that it wouldnt look real or realistic but when I tried it out it was pleasantly surprised on how real it looked.

Explanation:

3 0
3 years ago
Other questions:
  • Work AreaWhen creating a program in Visual Studio, the windows form object you are designing will appear in the _________ of the
    7·1 answer
  • Would you recommend the 4a generations of computers to a friend
    5·1 answer
  • Adele’s mother owns a Daycare and she wants to learn all about this business, to help her mom and own it one day. Which CTSO sho
    9·1 answer
  • To rotate text in a cell, select the _____ option in the alignment grouping.
    8·1 answer
  • Chief technology officers can influence a company's current and future ____.
    9·1 answer
  • Sketch a 3-view orthographic projection of the object shown
    6·1 answer
  • The US government appropriates less than one million dollars in funding each year to STEM education programs. True False
    7·2 answers
  • When should you close the socket python tcp server client.
    7·1 answer
  • Add me as a friend on Real pool 3D so we can play a round of pool!!!
    10·1 answer
  • shayne keeps his home office computer on his desk. he wants to use a wireless keyboard and mouse, and to send output to his prin
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!