Read all the questions and solve them in your notebook for better practice. Always break down each question into smaller parts before solving it.
Question 1:
Write a pseudocode to store the prices of 8 items in a one-dimensional array.
The program should then ask the user to enter a price value and search for it using linear search.
If the price is found, display “Price found at position X”, otherwise display “Price not found”.
(4 marks)
Question 2:
Write a pseudocode that stores the roll numbers of 10 students in a one-dimensional array.
The program should then ask the user to input a roll number to search.
If the roll number exists, display “Student is registered”, otherwise display “Student not found”.
(4 marks)
Question 3:
Write a pseudocode to store 5 city names in an array.
The program should then ask the user to enter a city name to search.
If the city is present in the list, display “City found”, otherwise display “City not found”.
(3 marks)
Question 4:
Write a pseudocode to store 10 temperatures recorded during a week.
The program should then ask the user to input a temperature value and use linear search to check if it was recorded.
If found, display “Temperature recorded”, otherwise display “Temperature not recorded”.
(4 marks)
Question 5:
Write a pseudocode to store the marks of 6 students in a one-dimensional array.
The program should then ask the user to enter a specific mark to search for.
If the mark is found, output the position number, otherwise display “Mark not found”.
(4 marks)
