0% found this document useful (0 votes)
2 views1 page

Inventory and Movie Ratings Lab Tasks

The document outlines the lab evaluation for I B.Tech. CSE students at Amrita School of Computing, focusing on computational problem solving. It includes two main tasks: creating an inventory management system and managing movie ratings, each with specific functions to implement. The total marks for the evaluation are 20, with detailed instructions for each task and their associated course outcomes.

Uploaded by

vamsidhar9191
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)
2 views1 page

Inventory and Movie Ratings Lab Tasks

The document outlines the lab evaluation for I B.Tech. CSE students at Amrita School of Computing, focusing on computational problem solving. It includes two main tasks: creating an inventory management system and managing movie ratings, each with specific functions to implement. The total marks for the evaluation are 20, with detailed instructions for each task and their associated course outcomes.

Uploaded by

vamsidhar9191
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

Set - 2

Amrita School of Computing


Department of Computer Science and Engineering
I [Link]. CSE (2023-27) – Section ‘F’
23CSE006 Computational Problem Solving
Lab Evaluation - II

Date: 01 – Dec – 2023, Friday Time: 02:20 pm to 03:15 pm (1 hr. & 15 min.)
Total Marks: 20
CO# Course Outcomes
CO01 Apply algorithmic thinking to understand, define and solve problems.
CO02 Design and implement algorithm(s) for a given problem.
CO03 Apply the basic programming constructs for developing solutions and programs.
Analyze an algorithm by tracing its computational states, identifying bugs and
CO04
correcting them.

1. You are tasked with creating a simple inventory management system for a small store. The
store sells different types of products, and the inventory data is stored in a list of tuples. Each
tuple represents a product and contains the following information: (product_id, product_name,
quantity, price_per_unit) (10 marks) [CO3][BTL3]
i. Initialize an empty list called inventory to store the product information. (2 marks)
ii. Write a function called add_product that takes parameters for product information (id,
name, quantity, price) and adds a new tuple to the inventory list. (2 marks)
iii. Write a function called update_quantity that takes a product ID and a quantity to add or
subtract. This function should update the quantity of the specified product in the
inventory. (2 marks)
iv. Write a function called calculate_inventory_value that calculates and returns the total
value of the inventory (sum of quantity * price for each product). (2 marks)
v. Write a function called display_inventory that prints out the details of each product in
the inventory. (2 marks)

2. Exercise: Movie Ratings (10 marks) [CO3][BTL3]


You are creating a program to manage and analyze movie ratings. The movie data is
represented using dictionaries, where the keys are movie titles, and the values are dictionaries
containing information about each movie, including the rating and release year.
i. Initialize an empty dictionary called movie_ratings to store the movie information. (2
marks)
ii. Write a function called add_movie that takes parameters for a movie title, rating, and
release year. This function should add a new entry to the movie_ratings dictionary. (2
marks)
iii. Write a function called get_average_rating that calculates and returns the average
rating for all movies in the dictionary. (3 marks)
vi. Write a function called display_highest_rated_movie that prints out the title and rating
of the movie with the highest rating. (3 marks)

You might also like