0% found this document useful (0 votes)
767 views2 pages

Algorithmic Thinking With Python

This document outlines the structure and content of the First Internal Exam for the UCEST105 - Algorithmic Thinking with Python course at the College of Engineering Trivandrum. It includes various questions on algorithm design, problem-solving strategies, and programming concepts, divided into two parts with specific marks allocated. The exam tests students' understanding of algorithms, data structures, and their application in real-world scenarios.

Uploaded by

Rinosha Prakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
767 views2 pages

Algorithmic Thinking With Python

This document outlines the structure and content of the First Internal Exam for the UCEST105 - Algorithmic Thinking with Python course at the College of Engineering Trivandrum. It includes various questions on algorithm design, problem-solving strategies, and programming concepts, divided into two parts with specific marks allocated. The exam tests students' understanding of algorithms, data structures, and their application in real-world scenarios.

Uploaded by

Rinosha Prakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COLLEGE OF ENGINEERING TRIVANDRUM

FIRST SEMESTER B. TECH DEGREE


First Internal Exam -November 2024
UCEST105 - ALGORITHMIC THINKING WITH PYTHON
Max. Marks: 40 Duration: 2 Hours

Part A(Answer All Questions) Ma CO Kle


vel
rks
Six glasses are arranged in a rovw, the first three full of juice, the second [31 2 K3
three empty. By moving only one glass, can you arrange them so that empty
and full glasses alternate?
You are planning a cross-country road trip, aiming to visit multiple cities 3] 2 K3
while minimizing travel time. Using aheuristic approach, describe how you
would choose the next city to visit at each stop, prioritizing cities that are
closer to the current location to make the journey more efficient.
3 What is a looping construct? How does the "while" loop differ from the [3] 1 KI
"repeat-until" loop?
4
Design an algorithm to reverse the digits of apositive integer. [3] K3

Part B(Answer any one fullquestion from each module. Each question carries 14 marks)
Modulel
5a You need to renovate a house within a budget and a limited time frame, [S] 2 K3
which involves painting, installing new flooring, and upgrading the kitchen.
Using the Means-End Analysis strategy, explain how you would prioritize
tasks and allocate resources to ensure that the most critical renovations are
completed on time and within budget.
5b A pile of mangoes was collected. The king took one-sixth, the queen one [5] 2 K3
fifth of the remainder, the three princes one-fourth, one-third, and one-half
of the successive remainders, and the youngest child took the three
remaining mangoes. Find the number of mangoes in the pile. 18
5c Give the output of any four relationaloperators using the two operands a = [4] K3
5, and b=3.
OR
6a You are organizing a department-level coding competition as part of the [S] 2 K3
technical event for our college called "Drishti" next month. Using the
"working backwards" strategy, outline the steps you need to take to ensure
the event is successful.
6b Apostal clerk sold some 15Rs stamps and some 25Rs stamps. Altogether, (5] 2 K3
15 stamps were sold for a total cost of 315Rs. How many of each type of
stamps were sold?
Give the output of any four bitwiseoperators using the two operands a = 2, [4] 1 K3
and b =3.
Module2

You are tasked with writing an algorithm that evaluates a student's grade [8 K3
based on their score. The algorithm should categorize the score into a letter
grade (A, B, C, D, or F)using both an if-else structure and a case structure
(switch statement).
Requirements:
Prompt theuser to input a numeric score (0 to 100).
Use an if-else statement to determine the letter grade:
A: 90-100
B: 80-89
C: 70-79
D: 60-69
F: Below 60
Use a switch statement (case structure) to determine the letter grade:
You may need to convert the numeric score into ranges for the case structure
(e.g., floor the score to the ncarest ten).
Print the corresponding lettergrade from both methods.
7b Design an algorithm for the following problem. [6]) 2 K3
Given a sequence of n integers in the range 1 to 5, return the top k frequent
elements.
Input: n,n integers in the range 1to 5 and an integer k.
Output: The k most frequent elements in the sequence.
Example:
Input: n=6, 1, 1, 1, 2, 2,3, k=2
Output: 1, 2
OR
8 Write an algorithm that finds the sum of all prime numbers from 1to agiven| [10] 1 K3
integer n (inclusive). Your algorithm should use both a while loop and a for
loop to demonstrate the calculation.
Write an algorithm to find the minimum and maximum elements in a [4] 2 K3
sequence of n integers.
Input: n, a sequence of n integers.
Output: The minimum and maximum values in the sequence.
Example:
Input: n =6,3, 1, 4, 1, 5,9
Output: Minimum: 1, Maximum: 9

Co1: Utilize computing as a model for solving real-world problems.


CO2: Articulate a problem before attempting to solve it and prepare a clear and
accurate model to represent the problem.

You might also like