Question: A supermarket maintains a pricing format fo its products. A value N is printed on each product. Whe scanner reads the value N on the item, the product of al digits in the value N is the price of the item. The task he to design the software such that given the code of any ite the product (multiplication) of all the digits of value sho be computed(price). Example 1: Input

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 20PE
icon
Related questions
icon
Concept explainers
Question

 

 

Question: A supermarket maintains a pricing format for all
its products. A value N is printed on each product. When the
scanner reads the value N on the item, the product of all the
digits in the value N is the price of the item. The task here is
to design the software such that given the code of any item N
the product (multiplication) of all the digits of value should
be computed (price).
Example 1:
Input :
5244 -> Value of N
Output:
160 -> Price
Explanation:
From the input above
Product of the digits 5,2,4,4
5*2*4*4= 160
Hence, output is 160.
Transcribed Image Text:Question: A supermarket maintains a pricing format for all its products. A value N is printed on each product. When the scanner reads the value N on the item, the product of all the digits in the value N is the price of the item. The task here is to design the software such that given the code of any item N the product (multiplication) of all the digits of value should be computed (price). Example 1: Input : 5244 -> Value of N Output: 160 -> Price Explanation: From the input above Product of the digits 5,2,4,4 5*2*4*4= 160 Hence, output is 160.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr