Average of Given Numbers
You are given space-separated integers as input. Write a program to print the average of the given numbers.
Input
The first line of input contains space-separated integers.
Output
The output should be a float value rounded up to two decimal places.
Explanation
In the example, input is
1, 0, 2, 5, 9, 8. The sum of all numbers present in the list is 25, and their average is 25/6.
So, the output should be
4.17.
Sample Input 1
1 0 2 5 9 8
Sample Output 1
4.17
Sample Input 2
1 2 3 4 5
Sample Output 2
3.0
Reverse the sentence
your are given a string S as input , write a program to print the string after reversing words of the given sentence.
the first line of input is S.
in the given example the sentence "This is Python" contain 3 words ,when reversing the word "Python" comes to the starting of the sentence and "This" goes to the last of the sentence ,the word "is" remains in the same position.
so the output should be Python is This.
SAMPLE INPUT 1
This is Python
OUTPUT :- Python is This
SAMPLE INPUT 2
Hi! World Hello
OUTPUT:- Hello World Hi!
Given is GROSS_PAY, draw a flowchart that will compute for DEDUCTIONS and NET_PAY for employee’s weekly Payroll. Consider the conditions:
If Civil Status = ‘SINGLE’
DEDUCTIONS = GROSS_PAY * 0.03
If Civil Status = ‘MARRIED’
DEDUCTIONS = GROSS_PAY * 0.06
If Civil Status = ‘WIDOW’
DEDUCTIONS = GROSS_PAY * 0.05
If Civil Status = HEAD OF THE FAMILY’
DEDUCTIONS = GROSS_PAY * 0.02
Using the formula:
Questions:
1.Would you be able to make use of this knowledge obtained in this module? In what scenario would it be about the 3R's environmental policies.
2.Will you apply it personally or in the future when you are already working for a company? What scenario that would be?
3.What do you think are the importance of 3R's environmental policies?
4.How will you use the knowledge you acquired about 3R's environmental policies?
5.Cite a situation in which you can apply the knowledge of understanding 3R's environmental policies.
Write a menu driven application to maintain the department details of a School
using Java to demonstrate the concept of Inheritance. Your application must contain
the following functionalities along with the use of method overriding, and super
keyword. Consider the example of school of CST having three departments CSE,
AI&SD and CE.
a. For each department maintain the following details.
i. deptName
ii. hodName
iii. noOfFaculty
iv. noOfStudents
v. noOfPrograms
b. Get the department details from user(admin)
c. Display the Department list with all details in a proper and neat format.
d. In the menu give an option to display department wise details.
(Use Big O to calculate the following time complexity)
Q 1
def printPairs(array):
for i in array:
for j in array:
print(str(i)+","+str(j))
Q2
def printUnorderedPairs(array):
for i in range(0,len(array)):
for j in range(i+1,len(array)):
print(array[i] + "," + array[j])
#Question3
def printUnorderedPairs(arrayA, arrayB):
for i in range(len(arrayA)):
for j in range(len(arrayB)):
if arrayA[i] < arrayB[j]:
print(str(arrayA[i]) + "," + str(arrayB[j]))
arrayA = [1,2,3,4,5]
arrayB = [2,6,7,8]
You are given a square matrix A of dimensions NxN and an integer X which means is an element of A, write a program to find P by performing the following table
Do you like reading books? If you do, then you must have encountered texts that have quite a wide space with dots in between them, just like pausing or thinking before proceeding the narration. Let's try doing that here in C, shall we?
Input
Two lines containing a string on each.
Cody
Handsome
Output
Multiple lines containing a string on each.
Cody
Handsome
(Use Big O to calculate the following time complexity)
Q 1
def printPairs(array):
for i in array:
for j in array:
print(str(i)+","+str(j))
Q2
def printUnorderedPairs(array):
for i in range(0,len(array)):
for j in range(i+1,len(array)):
print(array[i] + "," + array[j])
#Question3
def printUnorderedPairs(arrayA, arrayB):
for i in range(len(arrayA)):
for j in range(len(arrayB)):
if arrayA[i] < arrayB[j]:
print(str(arrayA[i]) + "," + str(arrayB[j]))
arrayA = [1,2,3,4,5]
arrayB = [2,6,7,8]
construct a python program to A taxi driver charges the bill as follows. On a fine day, Mr. Roy travels to his office by the taxi. Write a Python program to accept the kilometers traveled by Mr. Roy and calculate his taxi bill.