Algorithmic Thinking with Python UCEST 105 university question paper and solution ( UCEST 105 answer key )
1.How do you use a decomposition strategy to design a menu-driven calculator that supports four basic arithmetic operators - addition, subtraction, multiplication, and division? To design a menu-driven calculator using a decomposition strategy , you break the problem into smaller, manageable sub-tasks. Here's how to approach it step by step: 1. Problem Decomposition Break down the calculator into smaller components based on the tasks: Input Handling : Accept user input for numbers and operator selection. Operation Implementation : Define how each arithmetic operation (addition, subtraction, multiplication, and division) will be performed. Menu Management : Create a menu interface that allows users to select the desired operation. Output Handling : Display the result of the operation. Program Loop : Allow users to perform multiple operations by looping until they choose to exit. 2. Design Components The key components of the calculator can be: Input Functions : For accepting nu...