IO Problems

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Question:

Identify the Input, Output variables and their most applicable data types For the following problems:

Problem 1
A pizza restaurant sells 4 types of pizza (Tandoori Chicken Pizza, Chicken Ranch Pizza, Seafood Pizza and Supreme Pizza). The restaurant wants to generate a weekly report showing the total number of pizza sold for each type of pizza during a week. In addition, it shows the average pizza sold of all types for each day of a week. Also, it shows the pizza names for the most frequently sold and least frequently sold pizzas.

Sample Solution for Problem 1: Input: Output: Total pizza sold for each type during a week: 4 variables of type integer, one for each type The average pizza (all types) sold for each day: 7 variables of type float are needed for each day of a week. The name of the most frequently sold pizza: 1 variable of type string The name of the least frequently sold pizza: 1 variable of type string Number of Pizza Sold for each type in Specific day: 4 Types x 7 Days = we need 2D array (size 4x7) of type integer (or 28 variables of type integer). The name of each pizza type: 1D array of strings of size 4 (4 strings variables)

Problem 2
A company wants to track all items available in their store. Each item has a name, 12 digits serial code, weight measured in KG, quantity and item category (i.e. Office furniture, Cables, Computers). A weekly report should be generated showing the name of the heaviest item available in the store, the number of categories, the name of the category with the highest number of items, the serial code for the item that has the highest quantity, and the average weight for all items in the store.

You might also like