Programming and Problem Solving
CSE · Quiz · Spring 26
Paper 2 of 6By Shaker Abdullah (2)Switch
Paper 2 of 6
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
CSE113: Programming and Problem Solving
Spring 2026
Quiz - 4
Duration: 35 Minutes
Q1 [7]
Assume you are working as a software engineer developing a search system.
There are n user names stored in a database (array). Users can search for their names, and the system should suggest all names that contain the given substring.
To make the application user-friendly, write a function that takes a name and the substring as parameters to display all names that contain the entered substring.
Input:
- The first line contains an integer n (number of users).
- Next n lines each contain a user name (string may have spaces).
- The last line contains a substring of length 4.
Output:
- Print all users' names that contain the given substring.
Sample Input | Sample output
6 | Anna Marie
Soul Goodman | Joanna Grace
Anna Marie | Hannah Claire
Annette Rose |
Joanna Grace |
Annika Noor |
Hannah Claire |
anna |
Note: Matching should be case-insensitive.
Q2 [6]
You are developing a simple monitoring system for a weather station. The system records temperatures (in °C) for n days and 3 different time slots per day (morning, afternoon, evening).
Now you need to display the maximum temperature along with the day and time slot where it occurred.
Input:
- The first line contains an integer n (number of days).
- Next n lines each contain 3 integers representing temperatures.
Output:
- Print the maximum temperature and position (day and time slot).
Sample Input | Sample output
3 3 | Maximum Temperature: 36
30 32 31 | Found at Day 3, Time Slot 3
29 35 33 |
28 34 36 |
Hint: You can store the temperatures in a 2D array.
Q3 [2]
Create a meme about your student life and write 2-3 lines about it.
Or,
Write 2-3 lines about your hobby.