Answered step by step
Verified Expert Solution
Link Copied!

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 500 different sorts of sweets. Each sort of sweet is identified by a unique four-digit code. All sweets that start with a one (1) are chocolates, all sweets that start with a two (2) are toffees, all sweets that start with a three (3) are jellies and all other sweets are miscellaneous and can start with any other digit except zero.
Write a program, which inputs the four-digit code for all 500 items and outputs the number of chocolates, toffees and jellies. [10 Marks]
2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions