Workers of Maunlad Corp. have 40 regular working hours per week and are paid with an hourly rate based
on their years of service in the company.
Years of service Hourly Rate
1 90
2 – 3 130
4 – 5 160
6 and above 200
However, if a worker rendered more than 40 hours in a week, the excess hours are paid 75% more. Design a program that allows the user to input the worker’s years of service and the number of hours rendered by a worker in 1 week then display the salary.
New Dictionary
Peter is making a new dictionary.He wants to arrange the words in the ascending order of their length and later arrange the ones with the same length in lexicographic order.Each word is given a serial number according to its position.Find the word according to the serial number.
Input
The first line of input is a positive integer which is the serial number.
Output
The output should be a single line containing the word that represents the serial number.
Explanation
Given serial number is 42.
As the serial number is between 26 and 52, the first character of the word is A.The remaining counter of the serial number is 16 (42-26).
The second character of the word is the 16th alphabet, which is P.
So, the output should be AP.
Sample Input1
42
Sample Output1
AP
Sample input2
751
Sample output2
ABW
write a python function Check_RollNo(A, n) (Refer RollNo_W8B_3.py ) which take a list A and nth roll number as input and return first nth roll number and Second roll number from the nth last roll number as shown in example. If nth roll number is not lies in the range of list, then function will return "n is not in range" in place of first roll number and empty string (“”) in place of second roll number
While taking a viva class teacher decides to take the viva of two roll numbers at a time.
For this she calls the roll numbers from roll numbers list as : one roll number from 1st nth roll number and 2nd roll number from the nth last roll number. For example if the numbers are : roll-num=[21,23,45,6,7,23,9,11,15,18] and n=3. One roll number calls 45 for viva and
second roll number called 11 for viva. Write a python function CRN(X, n) which take a list X and nth roll no. as input and returns 1st nth roll no. and 2nd roll no. from nth last roll no.
If nth roll number does not lie in range of the list the function will return "n not in range" in place of 1st roll no. and empty string " " in place of 2nd roll number. Give fixed input .
Convert the Number
Given a number having ten digits, convert it to a string following the below-mentioned rules.
Rules for conversion:
1.separate the number into a set of four-three-three digits
2.Use the following prefixes for successive digits
a.Single numbers: just read them separately
b.Two consecutive numbers: double
c.Three consecutive numbers: triple
d.Four consecutive numbers: quadruple
Input
The first line of input is a string of ten digits.
Sample Input1
9887666668
sample Output1
nine double eight seven triplesix double six eight
Sample Input2
9090407368
Sample Output2
nine zero nine zero four zero seven three six eight
For a certain academic subject the students are evaluated based on five tests -
Design a program that will prompt the user for marks for each of the tests and calculate the overall marks (out of 100).
Write a program that has two functions: the main function and a function, called sumOfSquared(n), that takes an integer number (read in the main function uisng input) and calculates the total sum of squares of all numbers from 1 to a given number. Then, it returns the result to the main function. Finally, the result should be printed.
Final Project - TicTacToe Human vs. Computer 2 # 3 # Purpose: using a nested list structure to store a 3x3 grid of values 4 # simulate a childhood game of tic-tac-toe. The human player interacts 5 # with a full command line interface to select board positions.
Area of a Sub-matrix
You are given an M*N matrix and K, write a program to compute the area of the sub-matrix and print the result.
A sub-matrix is a matrix formed after deleting K rows each from the top and bottom and K columns each from left and right.
Area of a matrix is defined as the product of all elements of the matrix.
Explanation
For M = 5 and N = 4, the matrix is:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
For K = 1, the sub-matrix is as follows:
6 7
10 11
14 15
Therefore, the area of the matrix is 6*7*10*11*14*15 = 970200.
Sample Input1
5 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
1
Sample Output1
970200
New Dictionary
Peter is making a new dictionary.He wants to arrange the words in the ascending order of their length and later arrange the ones with the same length in lexicographic order.Each word is given a serial number according to its position.Find the word according to the serial number.
Input
The first line of input is a positive integer which is the serial number.
Output
The output should be a single line containing the word that represents the serial number.
Explanation
Given serial number is 42.
As the serial number is between 26 and 52, the first character of the word is A.The remaining counter of the serial number is 16 (42-26).
The second character of the word is the 16th alphabet, which is P.
So, the output should be AP.
Sample Input1
42
Sample Output1
AP
Sample input2
751
Sample output2
ABW