Justify the following statement with the help of a suitable example: “In a class hierarchy of several levels of several levels, if we want a function at any level to be called through a base class pointer then the function must be declared as virtual in the base class”.
Create a generic function max that gives the maximum value of three generic type arguments that are passed to it. Then test this function by calling it with char, int, and float type. (Please provide executeable code in C++).
Write a program to find the number of registered students in each semester for BIT and IT students, implemented as an array of students records. The student record has the following fields -nine digit student number, -student name, -student surname, -program registered for, -semester registered for. Assume that the above data is read from a line of a text file -"STDTA.txt". Your program should display the above information with the total number of students registered for BIT, the total number of students registered for IT, and it should also display the count of students in each semester for both BIT and IT.
Write a program to find owing students in each semester for BIT and IT, implemented as an array of students records. The student record has the following fields: -nine digits student ID number, -student name, -student surname, - program registered for, -semester registered for. Assume that the above data is read from a line of a text file - "STDTA.txt". Your program should display the information of all students BIT and IT who have paid less than £1900.00, the total owed by the students, and it should also display the count of owing student in each program (BIT and IT)
Create a class IntClass with integer array as data member. Create a class CharClass with Char array as
data member. Convert CharClass array to IntClass. Overload + operator to add the converted data
member with the existing IntClass data member. Addition should be done based on index of the arrays.
Display the sum values.
Q1. A random variable is defined as “ thenumber of heads when
a coin tossed”,
(a)twice
(b)three times
(c)four times
(d)five times
Find the PDF of each of them and their respective mean and variance.
Q(2)A random variable is defined as Construct the probability distribution function
of X and find the standard deviation of X.
Q(3)It is known that only 60% of a defected computer can be
repaired. A sample of 15 Pc is selected randomly,
find the probability that;
(i) None can be repaired
(ii) 5 or less can be repaired
(iii) At least 3 computers can be repaired.
Ordered Matrix
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.Explanation
For example, if the given M is 3 and N is 3, read the inputs in the next three lines if the numbers given in the next three lines are the following.
1 20 3
30 10 2
5 11 15By ordering all the elements of the matrix in increasing order, the ordered matrix should be
1 2 3
5 10 11
15 20 30Sample Input 1
3 3
1 20 3
30 10 2
5 11 15
Sample Output 1
1 2 3
5 10 11
15 20 30
Sample Input 2
2 5
-50 20 3 25 -20
88 17 38 72 -10
Sample Output 2
-50 -20 -10 3 17
20 25 38 72 88
Software Testing is the process of examining and verifying a software product with the purpose of identifying any errors, gaps or missing requirement versus the actual requirement. Do you think that Software Testing is a destructive activity? Yes, or No.
Zig-zag order in matrix;;
Input:---
4 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Output :--
1 2 3 4 5 6 7 8 9 10 11 12 16 15 14 13
Input 2:---
3 4
1 2 3 4
10 11 12 5
9 8 7 6
Output 2:--
1 2 3 4 5 12 11 10 9 8 7 6
s = input()
s = s.lower()
s2 = s.split()
s3 = ''.join(s2)
if s3 == s3[::-1]:
print("True")
else:
print("False")In this python program it has three test cases, in this three test cases two test cases are getting expected output and third test case are not getting expected output. Please give me expexted output for three test cases. Thank you !
Question url :-
https://drive.google.com/file/d/1ZELb2KSvV36MM4kiF-dTFTC43CeUiFH9/view?usp=sharing
Test case - 1
Input
No lemon no melon
Output
True
Test case - 2
Input
Race Cars
Output
False
Test case - 3
Input
God’s Dog
Output
True