Question Details

[solution]: Geller Florist Inc. had the following transactions during 2015:


Answer download
More Details:

My code is not generating the correct output. Please have a look and correct.


Double Double: Scoops with Trouble

 

Filename: scoop

 

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:

 

Qualifier

 

Double

 

Triple

 

Quadruple

 


 

Multiplier

 

×2

 

×3

 

×4

 


 

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.

 

The Problem:

 

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:

 

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.

 

The Output:

 

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

 

line.

 


 

18

 


 

Sample Input:

 

3

 

Double Scoop

 

Triple Quadruple Scoop

 

Double Double Scoop

 

Sample Output:

 

Order #1: 2

 

Order #2: 12

 

Order #3: 4

 


 

19

 


 

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Dec 18, 2020

PRICE: $18.50

Solution~00031148033935.zip (25.37 KB)

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 .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Dec 18, 2020

EXPERT

Tutor

ANSWER RATING

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).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

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.

Order Now