Escolar Documentos
Profissional Documentos
Cultura Documentos
OVERNIGHT PROGRAMMING PROBLEM FOR MCA
In a LAN (Local Area Network) usually computer are connected in a linear topology i.e. they are linked in
a chained manner, such that each computer connected to exactly two others. Exceptions are two
extreme end situated computers.
Looking to cost, maintainability, speed parameters, it is desirable to minimize the length of cable used.
You have to write a program to determine how the computers should be connected in chained manner
such that the total amount of cable needed is minimized. Compute the total cable length required for
networking. Since the cabling will run beneath the floor, the amount of cable used for joining two
adjacent computers on the network will require floor distance between two computers plus 3 meters to
connect from the floor to the computers (including slack for practical purpose).
EXAMPLE 1
Assume for following situation where Cn Is computer_id
15
14 C5
13
12
11
10
9 C3
8
7 C4
6
5
4 C2
3 C1
2
1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
INPUT
5
3, 3
7, 4
6, 9
11, 7
4, 14
OUTPUT C1 C2 C4 C3 C5
(4.1+1.5)+(5+3)+(5.3+3)+(5.3+1.5)=28.7 m
EXAMPLE 2
Assume for following situation where Cn Is computer_id
15
14
13
12 C3
11
10
9 C4
8
7 C5
6
5
4 C2
3 C1
2
1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
INPUT
5
3, 3
7, 4
15, 12
13, 9
11, 7
OUTPUT
C1 C2 C5 C4 C3
(4.1+1.5)+(5+3)+(2.8+3)+(3.6+1.5)=24.5 m
OVERNIGHT PROGRAMMING PROBLEM FOR BCA
Passwords are used for authentication purpose. Design software which checks for password for
following rules
1. The minimum length of Password should be 6 and maximum should be 12, both uppercase
and lowercase characters are allowed.
2. The password must start with a character
3. The password should have at least two digits (0‐9)
4. The special characters allowed in passwords are restricted to given set only
{!, @,#,$,%,^,&,*,<,>,?,~}
5. No sequence of characters is allowed in password.
6. Repetition of characters in adjacent not allowed
Example
a) L1@Cho0 Valid password
b) La1ch Invalid {Length less than 6} {Rule1}
c) #a12ho Invalid {not starting with char} {Rule 2}
d) Lachoo Invalid {digits missing} {Rule 3}
e) L12cho” Invalid {“ not allowed} {Rule 4}
f) L12Cab Invalid {ab is a sequence} {Rule 5}
g) L12choo Invalid { two successive oo not allowed}{Rule 6}
Submit your solutions by email on carpediematlmcst@gmail.com by 10 am of 28th September 2010.