Codedecode Classix
Codedecode Classix
Find the smallest integer that is greater than M and whose digits add up to N. For example, if M =
100 and N = 11, then the smallest integer greater than 100 whose digits add up to 11 is 119.
Write a program to accept the numbers M and N from the user and print the smallest required
number whose sum of the digits is equal to N. Also, print the total number of digits present in the
required number. The program should check for the validity of the inputs and display an appropriate
message for an invalid input. Test your program with the sample data and some random data:
Example 1
Input:
M = 100
N = 11
Output:
Example 2
Input:
M = 1500
N = 25
Output:
Example 3
Input:
M = 99
N = 11
Output:
Invalid Input
Example 4
Input:
M = 112
N = 130
Output:
Invalid Input
Shinchan has come to a mall with his mother. After requesting several times his mother has allowed
him to get one item from the vending machine. In the vending machine, firstly the coin has to be
inserted and then choice of condiment has to be made. The condiments are arranged in a tabular
form (in rows and columns). Shinchan has made his choice and inserted the row number and column
number. Output the name of the condiment selected by him. Use switch case to achieve the task.
Vending machine is arranged as (3 rows(numbered from 1-3) and 3 columns(numbered from 1-3)):
NOTE: If the row or column input is out of range, output "Invalid Input".
Input Format
Constraints
None
Output Format
A single string
Sample Input 0
11
Sample Output 0
Chips
Sample input 2
33
Output
Coca Cola
Students in Amity college have last two periods on Monday and Thursday reserved for labs. Students
have to attend the labs according to the day of the week, their department and the group they
belong to. Students get confused and often go to the incorrect lab. Help them out by creating a code
that takes three inputs:
NOTE:
Constraints
None
Output Format
A single string
Sample Input 0
Monday
CSE
Sample Output 0
Java
Sample Input 1
Thursday
ECE
Sample Output 1
C
Sample Input 2
Monday
MECH
Sample Output 2
Central Workshop
https://www.hackerrank.com/contests/victorypoint-conditional-statements/challenges/filters/
page:2
In a theater, there is a discount scheme announced where one gets a 10% discount on the total cost
of tickets when there is a bulk booking of more than 20 tickets, and a discount of 2% on the total
cost of tickets if a special coupon card is submitted. Develop a program to find the total cost as per
the scheme. The cost of one k class ticket is ₹75 and one q class is ₹150. Refreshments can also be
opted for by paying an additional of ₹50 per member.
Hint: A minimum of 5 and a maximum of 40 tickets have to be booked at a time else display
“Minimum of 5 and Maximum of 40 tickets have to be booked”. If class other than 'k' or 'q' is given,
output should be “Invalid Input”.
Input Format
Constraints
None
Output Format
A single number(double).
Sample Input 0
35
Sample Output 0
6475.00
Explanation 0
Price calculation:
Number of tickets = 35
Refreshments = 'y'
Class = 'q'
Sample Input 1
14
Sample Output 1
1729.00
Explanation 1
Price calculation:
Number of tickets = 14
Refreshments = 'y'
Class = 'k'
https://www.hackerrank.com/contests/2d-array-patterns-practice/challenges