Swap Letters
Anil is given a sentense S.He tries to make this sentence special.A sentence can be made special by swapping the character with the highest frequency with the character having the lowest frequency in the sentence.Help Anil by transforming the sentence into a special Sentence.
Note:
Consider Upper and lower case letters as different.
If there are multiple letters with the same frequency, choose the lower case letter that comes earliest in dictionary order.
a.If letters like x and B have the same frequency consider x.
b.If letters like x and b have the same frequency consider b.
Input
The first line of input is a string.
sample input1
Python is a programming language.
sample output1
Python is e progremming lenguega.
sample input2
CHECK your blood PRESSURE frequently.
sample output2
CHECK ybur olbbd PRESSURE frequently.
Special Numbers
You only like numbers that start with an odd digit.Anil gives you space-separated integers as input.Your task is left-rotate every number in the list(if required) So that it can be liked by you.
Note:
If there is no odd digit in the number, do not rotate it.
If a number starts with an odd digit, do not rotate it.
Input
The first line of input contains space-separated integers.
sample input1
21 503 256 550 86 979 281
sample output1
12 503 562 550 86 979 128
sample input2
2001 463 6219 669 473 1006 77734 110 20511
sample output2
1200 346 1962 966 734 1006 77734 110 51120
Separate Faulty Items
Jeff Ordered several items from an online shop.After receiving the order, he found that some were faulty.So, he wants to separate the faulty items from the rest.
You are given the prices of the items jeff ordered, where a negative sign indicates a faulty item.Write a program to shift the prices of all the faulty items to the left without changing the relative order of the input.
Input
The first line of input contains space separated integers.
sample input1
11 -12 13 -14 15 16
sample output1
-12 -14 11 13 15 16
sample input2
21 11 -3 -2 9
sample output2
-3 -2 21 11 9
Golden Scores
Write a program to print all the Golden Scores in the list by maintaining their relative order.
Note: The last score is always a golden score.
sample input1
4 5 1 3 2
sample output1
5 3 2
sample input2
9 8 10 12
sample output2
12
5. Create a class BasePlusCommissionEmployee
a. BasePlusCommissionEmployee class is a child class of CommissionEmployee. It should inherit all the attributes of CommissionEmployee class and add its own attribute baseSalary.
b. Create a method called calculateTotalEarning which should inherit super class method calculateCommission and add baseSalary in it.
c. Create a method called displayData which should display the FirstName, LastName, Age, Address, ContactNumber, EmployeeID, OrganizationName, Position and totalEarning.
6 Create a complete class diagram of Question-01. Show relationship/inheritance between class.
(the #292598 is the first part and #292608 is the second part of this question and this is their part so I am requesting that to answers number 6 please also include part 1 and 2 of this question. thank you :)
4. Create a class SalariedEmployee
a. SalariedEmployee class is a child class of Employee class. It should inherit all the attributes of
Employee class and add its own attribute baseSalary.
b. Create a method called CalculateNetSalary which should deduct 13% Provisional Tax, 1%
insurance and 3% Fed Tax from baseSalary and display the NetSalary.
c. Create a method called displayData which should display the FirstName, LastName, Age,
Address, ContactNumber, EmployeeID, OrganizationName, Position, baseSalary and
NetSalary.
1. Create a class Person
a. Initialize a class Person (Constructor method) with FirstName, LastName, Age, Address and Contact Number.
2. Create a class Employee
a. employee is a Person so Employee is a child class of Person class. Employee class
constructor/__init__ method will contain all the attributes of Person class and Employee
class own attributes which are EmployeeID, OrganizationName and Position
3. Create a class CommissionEmployee 15 Marks
a. CommissionEmployee is a child class of Employee class. It should inherit all the attributes of Employee class and its own attribute which is commissionRate
b. Create a method called calculateCommission, which should take input of gross sale from the user and based on the commission rate calculate the totalEarning.
c. Create a method called displayData which should display the FirstName, LastName, Age, Address, ContactNumber, EmployeeID, OrganizationName, Position, commissionRate and totalEarning.
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
You can use a minus sign to make a negative number like -2. What happens for each of the following and why?
>>> 2++2
>>> 2--2
>>> 2+-2
>>> 2-+2
Given an integer N as input. Write a program the yellow right-angle pattern of N lines as bellow.
Note:There is a space after each asterisk (*) Character.
Input
The first line is an integer N
Explanation
In the given example the yellow right angled triangle of side 5 .Therefore, the output should be.
*
* *
* *
* *
* * * * *
Sample Input 1
4
Sample Output 1
*
* *
* *
* * * *