Skip to content

Solutions for the coding assignments, IEM CSE Dept., 5th Semester.

Notifications You must be signed in to change notification settings

BALaka-18/IEM_Coding-5th-Semester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IEM_CSE Coding 5th Semester

Solutions for the coding assignments, IEM CSE Dept., 5th Semester.

DAY 1 : Vessel filling problem

Given two vessels, one of which can accommodate 'a' liters of water and the other which can accommodate 'b' liters of water, determine the number of steps required to obtain exactly 'c' liters of water in one of the vessels.

At the beginning both the vessels are empty. The following operations are counted as 'steps':

  1. Emptying a vessel
  2. Filling a vessel completely
  3. Pouring water from one vessel to the other, without spilling, until one of the vessels is either full or empty.

DAY 2 : Bit Pairs

Given N three-digit numbers, your task is to find the bit score of all N numbers and then print the number of pairs possible based on these calculated bit scores.

  1. Rule for calculating bit score from three digit number: From the 3-digit number, extract largest digit and multiply by 11 then extract smallest digit multiply by 7 then add both the result for getting bit pairs. Note: - Bit score should be of 2-digits, if above results in a 3-digit bit score, simply ignore most significant digit.

  2. Rules for making pairs from above calculated bit scores Condition for making pairs are Both bit scores should be in either odd position or even position to be eligible to form a pair. Pairs can be only made if most significant digits are the same and at most two pairs can be made for a given significant digit.


DAY 3 : Strings and length counts

Q.1. Given a string of words separated by spaces. The task is to find the first maximum length, even word, from the string. Eg: “You are given an array of n numbers” The answer would be “an” and not “of” because “an” comes before “of”.

(a) Now modify your code to display n th even length word (where n is given as user input).

(b) Modify your code to find the m th maximum length word.


About

Solutions for the coding assignments, IEM CSE Dept., 5th Semester.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages