Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A sweet shop sells 5 0 0 different sorts of sweets. Each sort of sweet is identified by a unique four - digit code. All
A sweet shop sells different sorts of sweets. Each sort of sweet is identified by a unique fourdigit code. All sweets that start with a one are chocolates, all sweets that start with a two are toffees, all sweets that start with a three are jellies and all other sweets are miscellaneous and can start with any other digit except zero. Write a program, which inputs the fourdigit code for all items and outputs the number of chocolates, toffees and jellies. Marks
A sweet shop sells different sorts of sweets. Each sort of sweet is identified by a unique fourdigit code. All sweets that start with a one are chocolates, all sweets that start with a two are toffees, all sweets that start with a three are jellies and all other sweets are miscellaneous and can start with any other digit except zero.
Write a program, which inputs the fourdigit code for all items and outputs the number of chocolates, toffees and jellies. Marks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started