Define a class Batsman with the following specifications:
Private members:
bcode 4 digits code number bname 20 characters innings, notout, runs integer type batavg it is calculated according to the formula – batavg =runs/(innings-notout) calcavg() Function to compute batavg
Public members:
readdata() Function to accept value from bcode, name, innings, notout and invoke the function calcavg(). displaydata() Function to display the data members.
Create the class Student consisting of data members register_no and name. Define array of objects by using constructor Student() to assign the values for the class Student data members, display() member function is used to display the information of student. Finally free the resources of data objects using destructor member function. (Note: Define object size of two)
Method overriding to calculate simple interestCreate an abstract class Bank with method calculateSimpleInterest method which takes the amount of type double and time of type int (in years) as parameters and returns double type simple interest with interest at 6 PPA.
Create classes BankA, BankB and BankC which extends class Bank and override the method calculateSimpleInterest. Class BankA, BankB, and BankC calculate the interest at 10 PPA, 9 PPA, and 7 PPA respectively in an overridden method.
Input
1
45000
3
where,
Output
13500.00
where the output in 2 decimal numbers.
Create a file named “Circle.txt” and write the following data:(10)
Circle 1, 5
Circle 2,10
Circle 3,4
Each Line has a Circle Name and its radius separated by a comma. You have to calculate the Area of
each circle using (pi*r*r)and write it at the end of every line. (5+ 10)
e.g
Circle 1 , 5, 78.5
Circle 2, 10, 314
Circle 3, 4, 50.24
Define a class Batsman with the following specifications:
Private members:
bcode 4 digits code number bname 20 characters innings, notout, runs integer type batavg it is calculated according to the formula – batavg =runs/(innings-notout) calcavg() Function to compute batavg
Public members:
readdata() Function to accept value from bcode, name, innings, notout and invoke the function calcavg(). displaydata() Function to display the data members.
Given polynomial, write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0 format.InputThe first line contains a single integer N. Next N lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes coefficient of Pi.OutputPrint the polynomial in the format Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0, where Pi's are powers in decreasing order, Ci is coefficient, and C0 is constant. There will be space before and after the plus or minus sign. If the coefficient is zero, then don't print the term. If the term with the highest degree is negative, the term should represent -Cix^Pi. For the term where power is 1, represent it as C1x instead of C1x^1. If the polynomial degree is zero and the constant term is also zero, then print 0 to represent the polynomial.For term Cix^Pi, if the coefficient of the term Ci is 1, print x^Pi instead of 1x^Pi.ExplanationIf N = 4For power 0,
You are given a square matrix A of dimensions NxN. You need to apply the below given 3 operations on the matrix A.Rotation: It is represented as R S where S is an integer in {90, 180, 270, 360, 450, ...} which denotes the number of degrees to rotate. You need to rotate the matrix A by angle S in the clockwise direction. The angle of rotation(S) will always be in multiples of 90 degrees.Update: It is represented as U X Y Z. In initial matrix A (as given in input), you need to update the element at row index X and column index Y with value Z.After the update, all the previous rotation operations have to be applied to the updated initial matrix.Querying: It is represented as Q K L. You need to print the value at row index K and column index L of the matrix A. InputThe first line contains a single integer N.Next N lines contain N space-separated integers Aij (i - index of the row, j - index of the column).Next lines contain various operations on the array. Each operation on each line
Given two polynomials A and B, write a program that adds the given two polynomials A and B.Input
The first line contains a single integer M. Next M lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes co-efficient of Pi for polynomial A.After that next line contains a single integer N. Next N lines contain two integers Pj, Cj separated with space, where Pj denotes power and Cj denotes co-efficient of Pj for polynomial B.Output Print the addition of polynomials A and B. The format for printing polynomials is: Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0, where Pi's are powers in decreasing order, Ci is co-efficient and C0 is constant, there will be space before and after the plus or minus sign. If co-efficient is zero then don't print the term. If the term with highest degree is negative, the term should be represented as -Cix^Pi. For the term where power is 1 represent it as C1x instead of C1x^1.
Given a string, write a program to print a secret message that replaces characters with numbers 'a' with 1, 'b' with 2, ..., 'z' with 26 where characters are separated by '-'.
Note: You need to replace both uppercase and lowercase characters. You can ignore replacing all characters that are not letters.
abcdefghij12345678910
klmnopqr1112131415161718
stuvwxyz1920212223242526Input
The input will be a string in the single line containing spaces and letters (both uppercase and lowercase).Output
The output should be a single line containing the secret message. All characters in the output should be in lower case.Explanation
For example, if the given input is "python", "p" should replaced with "16", similarly"y" with "25","t" with "20","h" with "8","o" with "15","n" with "14". So the output should be "16-25-20-8-15-14".
Given a string, write a program to mirror the characters of the string in alphabetical order to create a secret message.
Note: Mirroring the characters in alphabetical order replacing the letters 'a' with 'z', 'b' with 'y', ... , 'z' with 'a'. You need to mirror both uppercase and lowercase characters. You can ignore mirroring for all characters that are not letters.
abcdefghijklmzyxwvutsrqpon nopqrstuvwxyzmlkjihgfedcbaInput
The input will be a string in the single line containing spaces and letters (both uppercase and lowercase).Output
The output should be a single line containing the secret message. All characters in the output should be in lower case.
Explanation
For example, if the given input is "python", "p" should replaced with "k", similarly "y" with "b", "t" with "g", "h" with "s", "o" with "l", "n" with "m". So the output should be "kbgslm".