msc f10 1st LAB DSA_new

# msc f10 1st LAB DSA_new - DATE 4 3 11 Data Structure...

This preview shows pages 1–3. Sign up to view the full content.

DATE: 4 / 3 / 11 M.Sc IT Lab 1 Note: Print every Array before and after modification. *Attempt at least two problems from Section A and two from section B in lab . Section A Problem 1: Print the sum of the numbers in the array. Except the number 13 which is very unlucky, so it does not count and numbers that come immediately after a 13 also do not count. Sample example: {1, 2, 2, 1} → 6 {1, 1} → 2 {1, 2, 2, 1, 13,1} → 6 {1, 2, 2, 1, 13, 675,1}→ 7 Problem 2: Given an array of integers, print “Good” if the array contains two consecutive 3’s and Print “Bad” otherwise. Sample example: {1, 3, 3} → Good {1, 3, 1, 3} → Bad {3, 1, 3} → Bad Problem 3: Given an array of integers, Print “Good” if the sum of all the 2's in the array is exactly 8 and print “Bad” otherwise. {2, 3, 2, 2, 4, 2}) → Good {2, 3, 2, 2, 4, 2, 2} → Bad Punjab University College of Information Technology.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Problem 4:
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 03/12/2011 for the course MSC F10 taught by Professor Hamer during the Spring '11 term at UABC MX.

### Page1 / 3

msc f10 1st LAB DSA_new - DATE 4 3 11 Data Structure...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online