CSE140 – Assignment 1: List (Solution)

$ 20.99
Category:

Description

Max Marks: 10

Instructions

• This is an individual assignment.
• Try to attempt all questions.
• No extension days will be permitted.
• Make a .Zip file (rollno_Assignment1.zip) that contain all the questions. Make sure to number the questions correctly in the .Zip file.

a. Find if the student ‘P’ is present at the position ‘U’ in the row
b. Find the length of the row

Write a prolog program to solve the question.
Assume row consists of names of students denoted by unique value.

Q2. Assume the same situation as previous question where students are standing in a queue with each one holding basket of candies which contain some number of candies each (assume this to be the previous state), now distributor thought to reassign candies to students hence here distributor followed an algorithm where he gave xi number of candies to the ith student such that xi is summation of all candies given to the students before ith student in previous state. Write a prolog program to get updated values of candies with each student after distribution.

Assume first student standing in that queue gets same number of candies as he/she got in previous state.

Marks Distribution
• Question 1:
3 points for the implementation and 2 for the viva. If student is not able to explain the implementation part, he/she will fetch 0 in that question. (3+2=5)
• Question 2:
3 points for the implementation and 2 for the viva. If student is not able to explain the implementation part, he/she will fetch 0 in that question. (3+2=5)

Reviews

There are no reviews yet.

Be the first to review “CSE140 – Assignment 1: List (Solution)”

Your email address will not be published. Required fields are marked *