subject

XML is the basis for many interfaces and web services. Consequently, reading and manipulating XML data is a common task in software development. Description
An online plant distributor has recently experience a shortage in its supply of Anemone plants such that the price has increased by 20%. Their plant catalog is maintained in an XML file and they need a Python utility to find the plant by name, read the current price, change it by the specified percentage, and update the file. Writing this utility is your assignment.
Using Python's ElementTree XML API, create a Python program to perform the following tasks below. Note that your program's execution syntax must be as follows:
python xmlparse. py plant_catalog. xml plantName percentChange
1. Using ElementTree, read in this assignments XML file plant_catalog. xml specified by a command line parameter as shown above.
2. Find the plant by the name passed in as an argument on the command line (plantName above).
3. Once found, read the current price and adjust it by the command line argument percentChange. Note that this value could be anything in the range of -90 < percentChange < 100.
For example, if you run your script as follows:
python plant_catalog. xml "Greek Valerian" -20
with the original XML containing:

Greek Valerian
Polemonium caeruleum
Annual
Shade
4.36
071499

The resulting file should contain:

Greek Valerian
Polemonium caeruleum
Annual
Shade
3.48
071499

Note: You may reduce the precision of the calculation if you wish but it isn't required.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
The animal classthis class represents a an animal residing at a zoo. it has a weight (in pounds),height (in inches), a name, and a color. the methods in the class include constructors,getters, and a tostring. you will finish the implementation of these methods. referto the code documentation.1.getters: you will need to implement getter methods. these get a value (froma member variable) in the animal class. you will make a getter method toreturn each variable (weight, height, name, color). reference getname if youare having issues.2.tostring: you will need to finish the tostring method. this returns a stringcontaining information about an animal. the output string should be of theformat: ” (name) , a ( color )â’colored animal . ( weight ) pounds , ( height ) inches .\n”the height and weight are formatted to 1 decimal place. recall from lab 1how to format strings neatly using string. see the reference sectionfor more about string.format.
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
The "instance" relationship shows that something is an object of a
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
question
Computers and Technology, 24.06.2019 02:30
Assume a class window with accessor method getwidth that accepts no parameters and returns an integer. assume further an array of 3 window elements named winarr, has been declared and initialized. write a sequence of statements that prints out the width of the widest window in the array.
Answers: 2
You know the right answer?
XML is the basis for many interfaces and web services. Consequently, reading and manipulating XML da...
Questions
question
Biology, 07.04.2021 14:00
question
Mathematics, 07.04.2021 14:00
question
English, 07.04.2021 14:00
question
Chemistry, 07.04.2021 14:00
question
Chemistry, 07.04.2021 14:00
question
Chemistry, 07.04.2021 14:00
question
Social Studies, 07.04.2021 14:00
question
Mathematics, 07.04.2021 14:00
Questions on the website: 13722367