Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

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 triple six double six eight


Sample Input2

9090407368

Sample Output2

nine zero nine zero four zero seven three six eight


  1. *5.39 (Financial application: find the sales amount) You have just started a sales job in a department store. Your pay consists of a base salary plus a commission. The base salary is $5,000. The following scheme shows how to determine the commission rate:

   

https://revel-ise.pearson.com/courses/6123e8c3e405345b4db8cc88/pages/a01d5f11c73c1edccab32f3f774833239daa8769e Page 11 of 15

Programming Exercises from the Book: Chapter 5 8/23/21, 3:12 PM

Note that this is a graduated rate. The rate for the first $5,000 is at 8%, the next $5,000 is at 10%, and the rest is at 12%. If the sales amount is 25,000, the commission is 5,000 * 8% + 5,000 * 10% + 15,000 * 12% = 2,700. Your goal is to earn $30,000 a year. Write a program that finds the minimum sales you have to generate in order to make $30,000.


First Run Server.py on the HOST side and run Client.py on the User side

After running Client.py on the User side I need four functions that the user side runs: REGISTER user, Display Registered users, De-register User

To Register a user to the Host server (aka Connect to the host server) you must have the input: “REGISTER <username (any name)>, <IP address of that user that wants to register> <PORT #s (range limit is 49152 through 65535)>”

After running the REGISTER COMMAND, it will either output “REGISTERED” or “NOT REGISTERED” on the user client-side If “REGISTERED” output is displayed, the User client should now be connected to the Host Server and Host Server can either save registered(connected) users in a list/database and/or output on Host Server-side “Connection at <username of user client> <IP ADDRESS of user client> <port # of user client (range limit is 49152 through 65535 >”


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.


Word Serial Number

A 1

B 2

C 3

... ...

X 24

Y 25

Z 26

AA 27

AB 28

... ...

BA 53

... ...

ZZ 702

AAA 703

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



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


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


Find area and perimeter of square


Algorithm:


get the value of side

multiply side by side to calculate area

multiply side by 4 to calculate perimeter

print area

print perimeter


'''


side = eval(input("Enter the value of the side "))


area = side * side

perimeter = 4 * side


print ("The side of the square is",side)

print ("The area is",area)

print ("The perimeter is",perimeter)




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