Write a program using class ‘employee’ to compute the allowances, net pays and print on the screen. The class also should have the following data members: - Emp_no, basic_pay, house_rent, medical_allow, conveyance_allownce and net pay. The class should have the following member functions:- One member function ‘inputdata’ to get values in temp_no and basic_pay. One member function ‘compute_pay’ to compute allowances and net pay. The allowances and net pay is calculated as: o ‘house_rent’ is 45% of basic pay. o ‘Medical_allow’ is 15% of basic pay. o ‘conveyance_allownce’ is 10% of basic pay. o ‘net_pay’ is calculated as: net_pay=basic_pay+house_rent+medical_allown +conveyance_allownce One member function ‘print_pay’ to print the pay.
Given a M x N matrix, write a program to print the matrix after ordering all the elements of the matrix in increasing order.Input
The first line of input will contain two space-separated integers, denoting the M and N.
The next M following lines will contain N space-separated integers, denoting the elements of each list.Output
The output should be M lines containing the ordered matrix.
Note: There is a space at the end of each line.
can anyone please give the code?
Given a string, write a program to return the sum and average of the numbers that appear in the string, ignoring all other characters.Input
The input will be a single line containing a string.Output
The output should contain the sum and average of the numbers that appear in the string.
Note: Round the average value to two decimal places.
can anyone please give the code for this?
inputLine = input()
letters = "abcdefghijklmnopqrstuvwxyz"
secreMessage=""
for l in inputLine:
indexLetter=letters.find(l.lower())
if(indexLetter!=-1):
indexLetter+=1
secreMessage+=str(indexLetter)+"-"
else:
secreMessage+=l
print(secreMessage[:-1])
if we give input"sudheer kumar" it should print "s-u-d-h-e-e-r k-u-m-a-r" like this
but it is printing "s-u-d-h-e-e-r- k-u-m-a-r" like this
so can anyone please give correct code?
A CSMA/CD protocol is a good choice for a MAC protocol if you want the protocol to provide guaranteed bandwidth allocations to each user.
True
False
Consider congestion control in TCP. When a timeout occur at a sender during slowstart, the value of assthresh is set to one of the previous ssthresh value.
True
False
Design a C program to remove characters from the first string which are present in the second string.
Write a function to generate lottery numbers using rand() function. This void function takes an int array with size 5. It generates five random digits
A void function called get user input takes an int array, and an int parameter size. This array should have the same size as the lottery[] array.
A function that compares the two arrays, lottery[] and user[] and keeps count of the matching digits and returns the count.
A void function to display the lottery[] and user[] arrays.
Next output the number of matches. If the matches count is 5, announce that the user is a grand prize winner.
Write a program that simulates a lottery. The program should have an array of five integers named lottery and should generate a random number in the range of 0 through 9 for each element in the array. The user should enter five digits, which should be stored in an integer array named user. The program is to compare the corresponding elements in the two arrays and keep a count of the digits that match. For example the following shows the lottery array and the user array with sample numbers stored in each. There are two matching digits (elements 2 and 4).
Lottery digits: 7 4 9 1 4
User digits: 4 2 9 7 3
The program should display the random numbers stored in the lottery array and the number of matching digits. If all the digits match, display a message proclaiming the user as a grand prize winner.
Write a program to arrange fruits names in ascending order. Input will be given by user. Use array to perform the given task.