0% found this document useful (0 votes)
6 views2 pages

Programming Assignment 2

This programming assignment consists of five tasks involving string manipulation and condition checking. The tasks include concatenating words, determining a student's branch based on their roll number, verifying a vehicle's registration number, forming a sentence from multiple words, and checking the length of a string for odd or even. Each task requires the implementation of specific input-output operations and logical conditions.

Uploaded by

Shreyan Saha
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)
6 views2 pages

Programming Assignment 2

This programming assignment consists of five tasks involving string manipulation and condition checking. The tasks include concatenating words, determining a student's branch based on their roll number, verifying a vehicle's registration number, forming a sentence from multiple words, and checking the length of a string for odd or even. Each task requires the implementation of specific input-output operations and logical conditions.

Uploaded by

Shreyan Saha
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
You are on page 1/ 2

PROGRAMMING ASSIGNMENT - 2

Shreyan Saha
September 2023

1. Accept two words as input and print the two words after adding a space
between them.

2. A simple algorithm has to be designed to find out whether a student


belongs to the Data Science branch or not. The input will be a student’s
roll number, which is of the form BR18B0000. Here, BR represents the
branch code, 18 represents the year of joining, B represents the education
level and 0000 represents the specific identification given to the student
of that batch. The branch code for Data Science is DS. Write a program
which will print ”True” if the student belongs to Data Science branch and
”False” otherwise.

3. The police are trying to track a criminal based on the evidence available
at a crime site. Their main clue is a vehicle’s damaged number plate.
Only the string TN07 is visible. The format of the registration number
is AA00AA00, where the first two letters are alphabets, next two are
numbers, next two are again alphabets followed by two numbers at the
end. A number plate is picked from a database of registration numbers
and is given to you as input. Your task is to determine if this could belong
to the criminal or not. Print ”True” if the number plate contains TN07
and ”False” otherwise.
4. Accept five words as input and print the sentence formed by these words
after adding a space between consecutive words and a full stop at the end.

5. Take a string as input from the user and print ”Odd” if the length of
the string is an odd number and ”Even” if the length of the string is an
even number.

You might also like