Home / Questions / a=input(How much did you spend?:) For this proble" aria-describedby="eor" style="
a=input(How much did you spend?:) For this proble" aria-describedby="eor"> Instructions Forum Tutoring String Slicing and Dicing Problem program.py > a=input('How much did you spend?:) For this problem you must write a program that can extract the cost of, for example, one chocolate bar when given a sentence like $63.75 which bought me how many chocolate bar 25! Your program must first read a sentence from input. It should then use slicing to get the number of items and the total cost, and convert those values from strings into numbers. Finally, your program must calculate and print the cost of a single item (rounded down to the nearest cent). The output of your program should look like this: How much did you spend?: $63.75 which bought me how many $2.55 Your program must still work if the sentence contains a different number, cost or type of items: How much did you spend?: $35.00 which bought me how many $3.50 For this problem, you may assume that the number of items is always 2 digits (that is, it is between 10 and 99 ) and occurs at the end of the sentence followed by an exclaimation mark. You may also assume that the total cost is always between 10 and 99 and appears at the start of the sentence, and is always associated with the number of cents (exactly two digits). Submissions <> Output How much did you spend?: $63.75 which bought me how many chocola 63.75/25 Hint Convert the cost from dollars and cents into cents (how many cents in a dollar?), and use arithmetic operators over integers to calculate the per-item cost in cents, and convert this into a dollar and cent amount.
Apr 02 2020 View more View Less
Inventory SalesHerb Corporation holds 60 percent ownership of Spice Company. Each year, Spice purchases large quantities of a gnarl root used in producing health drinks. ...
May 12 2020Solve the application of derivatives using calculus.Use differentials to estimate the amount ofpaint needed to apply a coat 0.04 cm thick to a hemispherical domewith diam...
Aug 20 2021Short Answer1) Which energy system is used when a baseball player swings and hits a pitched baseball?2) The volume of blood ejected from the heart in one minute is what?...
Jan 09 2020You have written a put option on Diebold Inc. common stock. The option has an exercise price of $ 28 and Diebold’s stock currently trades at $ 30.50. The option premium i...
May 10 2020To complete this assessment you will need to find a wide span, steel portal framed building, either under construction or completed, and present an information report cov...
Jul 02 2020Which of the following can a vertically integrated firm that buys its components from independent suppliers avoid? A. Problems associated with transfer pricing decisions...
Jan 11 2020A Weight is supported by two aluminum 6061-T6 cables with diameter Dc 2.2 mm. Properties for this material can be obtained from table A-7(b) in your text (p779) C B 300 m...
May 16 2020Consider the following closed economy: M = 700; L(r, Y ) = Y − 20r; G = 450; T = 0.3Y ; I = 200 − 6.5r; C = 0.5(Y − T ); P = 1 (in the short run); Y= 1, 000 (full employ...
Feb 07 2020Annette’s Photo Shop is a retail store that sells cameras and photography supplies. Annette’s Photo Shop began operations April 1, 2016. The firm purchases its merchandis...
May 22 2020The product of 2 positive numbers is 588. minimize the sum ofthe 1st and three times the 2nd.Find:First number= ___________Second number=_____________
Aug 22 2021