My code is not generating the correct output. Please have a look and correct.
Double Double: Scoops with Trouble
After working hard competing in a programming event, Ula, Chad, and Fred decide to reward
themselves with a tasty treat and visit the Universal Confection Factory (UCF) to get their
favorite ice cream. There, they decide to order the largest ice cream cones their wallets can
muster but are having trouble figuring out exactly how many scoops of ice cream a particular
order would contain. Unfortunately, it seems like UCF has a peculiar method for ordering ice
cream. Instead of specifying exactly how many scoops you want, you start with an ice cream
cone containing 1 scoop and list qualifiers to increase the number of scoops by multiples. UCF
offers the following qualifiers to an order:
For example, a Double Scoop ice cream will contain 2 scoops (1 × 2 = 2) while a Triple
Quadruple Scoop ice cream will contain 12 scoops (1 × 3 × 4 = 12). Each order will contain at
least one of these qualifiers and each qualifier can be repeated as many times as needed. Unable
to calculate the number of scoops involved in a large order in their heads, they ask you to write a
program to do it for them.
For each order, output the total number of scoops of ice cream that the order contains. Because
multiple people will be ordering ice cream, your program should work for multiple orders.
The input consists of multiple ice cream orders. The input file begins with a positive integer, n,
on a line by itself, which represents the number of orders that need to be processed. Each of the
following n lines will contain 1 or more qualifiers followed by the word ?Scoop? with each
word separated by a single space. There will be at most 19 qualifiers in a particular order. The
qualifiers can appear in any sequence, but ?Scoop? will always be at the end of the line,
signifying the end of the order. All of the input is case sensitive.
Despite the latest advancements in ice cream stacking technology, no ice cream cone will ever
have more than 1,000,000 scoops.
For each order, output ?Order #i: x? where i is the current order number (starting at 1) and
x is the total number of ice cream scoops in that order. Each order should be printed on its own
Triple Quadruple Scoop
Double Double Scoop
Order #1: 2
Order #2: 12
Order #3: 4
This question was answered on: Dec 18, 2020
Buy this answer for only: $18.50
This attachment is locked
We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy (Deadline assured. Flexible pricing. TurnItIn Report provided)
Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
About this QuestionSTATUS
Dec 18, 2020EXPERT
GET INSTANT HELP/h4>
We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.
You can also use these solutions:
- As a reference for in-depth understanding of the subject.
- As a source of ideas / reasoning for your own research (if properly referenced)
- For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
NEW ASSIGNMENT HELP?
Order New Solution. Quick Turnaround
Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.
WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.