TCS Tech 9
TCS Tech 9
Answer: Option C
Answer: Option A
Q4. When the given code is executed, what will be the output that is printed?
Answer: 11
4 Graph
A. A-3, B-2
B. A-4, B-3
C. A-3, B-1
D. A-2, B-4
Answer: Option C
Answer: Option B
Answer: Option A
Q8. Write the output for the below code.
A. NullPointerException
B. Error in Main Method
C. Advanced Java
D. Java EE
Answer: Option C
Q9. A bus conductor has a bunch of coins, each coin has a different value. New coins are added
at the end of the bunch. Only coins are issued to customers from the top side of the bunch.
Developer X wants to implement this in application by the help of data structure. Which data
structure is best suitable for implementation of current logic?
A. Queue
B. Graph
C. Stack
D. Tree
Answer: Option A
Q10. What is the full form of ROI in the context of Software development?
A. Return-on-investment
B. Rationality-of-internet
C. Reduction-of-investment
D. Rate-of-integration
Answer: Option A
Coding
Q1. Take a single line text message from the user. Separate the vowels from the text. Find the
repeating occurrences of vowels from the text message. Display count of which vowel has
repeated how many times.
Display a new Text message by removing the vowel characters as output.
Display the output in the exact format shown below in example, after displaying count of
characters on next lines display the new text message on next line. “Hll wlcm” is the new text
message.
If a text message entered by a user does not contain any vowels then display 0 as output. If a
text message entered by a user contains any numeric value then display 0 as output.
If User enters a blank or empty text message, display “INVALID INPUT” as output. Message
“INVALID INPUT” is case sensitive. Display it in the exact format given.
Example1:
Input:
Hello welcome
Output
a:0
e:3
i:0
o:2
u:0
Hll wlcm
Example2:
Input:
Hll wlcm
Output:
0
Solution in C++:
Q2. Indian Premier League IPL Cricket Matches are organized for a few Days. The problem is to
prepare a timetable from Day 1 to Day n, where n depends on the number of teams
participating. Set A represents the Names of Teams participating. Set A will be input from the
user. Do not show an input user message. Directly accept the team names as string values and
enter q to stop taking inputs.
Write code to display Pairing of Teams and possible number of matches possible excluding Semi
Final and Final.
Note: Minimum 3 Teams are required and maximum limit of Teams is 12.
Example1:
Input Values
CHENNAI
MUMBAI
KOLKATA
PATNA
Q
Output Values
TOTAL MATCHES:6
CHENNAI-VS-MUMBAI
CHENNAI-VS-KOLKATA
CHENNAI-VS-PATNA
MUMBAI-VS-KOLKATA
MUMBAI-VS-PATNA
KOLKATA-VS-PATNA
Solution in C++: