Input
The letter to be checked
Description
N/A
Constraints
N/A
Sample
N/A
Output
The first line will contain a message prompt to input the letter to be checked.
The second line verifies whether the letter is a vowel or not.
Enter·the·letter:·a
Vowel
Input
Programmer's age
Description
N/A
Constraints
N/A
Sample
N/A
Output
The first line will contain a message prompt to input the Programmer's age.
The second line will contain either "Adult" or "Minor".
Enter·the·Programmer's·age:·19
Adult
Input
The Programmer's dad's age
Description
N/A
Constraints
N/A
Sample
N/A
Output
The first line will contain a message prompt to input The Programmer's dad's age.
The second line contains that inputted age.
The third line contains a string if his dad is a senior citizen.
Enter·The·Programmer's·dad's·age:·62
His·age·is·62
Senior·Citizen
Input
The four numbers
Description
N/A
Constraints
N/A
Sample
N/A
Output
The first four lines will contain message prompts to input the four numbers.
The last line will contain the sum of all positive numbers with two decimal places.
Enter·the·first·number:·12.1
Enter·the·second·number:·-321
Enter·the·third·number:·53.3
Enter·the·fourth·number:·-34
Sum·of·all·positive·numbers·=·65.40
Input
The first number, second number, third number, fourth number and fifth number contains:
Description
N/A
Constraints
This may be a decimal number.
Sample
N/A
Output
The first line will contain a message prompt to input the first number.
The second line will contain a message prompt to input the second number.
The third line will contain a message prompt to input the third number.
The fourth line will contain a message prompt to input the fourth number.
The fifth line will contain a message prompt to input the fifth number.
The last line contains the sum of all negative numbers rounded off and displayed with 2 decimal places.
Enter·the·first·number:·34
Enter·the·second·number:·43.5
Enter·the·third·number:·-53.24
Enter·the·fourth·number:·56.3
Enter·the·fifth·number:·-10.32
Sum·of·all·negative·integers·=·-63.56
Write a program that reads all the match outcomes and summarizes the information of all the matches.
Points are given to the teams based on the outcome of the match.
A win earns a team 3 points. A draw earns 1. A loss earns 0.
The following information is expected:
MP: Matches Played
W: Matches Won
D: Matches Drawn (Tied)
L: Matches Lost
P: Points
The output should contain summarized information of all the matches in a format similar to 'Team: CSK, Matches Played: 4, Won: 2, Lost: 1, Draw: 1, Points: 7' for each team in a new line.
If there are no teams to print in summary, print "No Output".
Show what happens when a variable defined outside a function has the same name as a local variable inside a function. Explain what happens to the value of each variable as the program runs.
Create a function that takes an argument. Give the function parameter a unique name. Show what happens when you try to use that parameter name outside the function. Explain the results.
IPL Match Details
Write a program that reads all the match outcomes and summarizes the information of all the matches.
Points are given to the teams based on the outcome of the match.
A win earns a team 3 points. A draw earns 1. A loss earns 0.
The following information is expected:
MP: Matches Played
W: Matches Won
D: Matches Drawn (Tied)
L: Matches Lost
P: Points
The team information should be displayed in descending order of points.
input:
6
CSK;RR;loss
RR;DD;draw
MI;KKR;win
KKR;RR;loss
CSK;DD;draw
MI;DD;draw
output:
Team: RR, Matches Played: 3, Won: 2, Lost: 0, Draw: 1, Points: 7
Team: MI, Matches Played: 2, Won: 1, Lost: 0, Draw: 1, Points: 4
Team: DD, Matches Played: 3, Won: 0, Lost: 0, Draw: 3, Points: 3
Team: CSK, Matches Played: 2, Won: 0, Lost: 1, Draw: 1, Points: 1
Team: KKR, Matches Played: 2, Won: 0, Lost: 2, Draw: 0, Points: 0