Consider the products in the Departmental Store. Each product has product Id, product Name, product Unit price etc. Perform the following operations with Item details in the Departmental Store. i) Search the item by the item it. ii) List the items which are less than Rs. 100 /= iii. Sort the items by the item price and display all the items.
Consider the products in the Departmental Store. Each product has prodduct Id, product Name, product Unit price etc. Perform the following operations with Item details in the Departmental Store
Write a C++ Program on Airline Reservation System using classes and inheritance concept. And other C++ statements also like if, if-else, switch, loops, functions, etc.
The Output Should include:
1) Book Flight (domestic and international)
2) Cancel Flight
3) Check Flight Status
4) Exit
For Input:
2
1 2
3 4
R 90
Q 0 0
Q 0 1
R 90
Q 0 0
U 0 0 6
Q 1 1
-1
Initial Matrix
1 2
3 4
For R 90, clockwise rotation by 90 degrees, the matrix will become
3 1
4 2
For Q 0 0, print the element at row index 0 and column index 0 of A, which is 3.
For Q 0 1, print the element at row index 0 and column index 1 of A, which is 1.
Again for R 90, clockwise rotation by 90 degrees, the matrix will become
4 3
2 1
For Q 0 0, print the element at row index 0 and column index 0 of A, which is 4.
For U 0 0 6, update the value at row index 0 and column index 0 in the initial matrix to 6.
6 2
3 4
After updating, we need to rotate the matrix by sum of all rotation angles applied till now
4 3
2 6
Next for Q 1 1, print the element at row index 1 and column index 1 of A, which is 6.
So the output should be
3
1
4
6Add two polynomials
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.
input:
4
0 5
1 0
2 10
3 6
3
0 1
1 2
2 4
output:
File "main.py", line 12
for j in range(m);
^
SyntaxError: invalid syntax
expected output:
6x^3 + 14x^2 + 2x + 6
please rectify it!!
i am using python 3.9
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.
input:
3 3
1 20 3
30 10 2
5 11 15
output:
Traceback (most recent call last):
File "main.py", line 1, in <module>
M=int(input())
ValueError: invalid literal for int() with base 10: '3 3'expected output:
1 2 3
5 10 11
15 20 30 input:
2 5
-50 20 3 25 -20
88 17 38 72 -10
expected output:
Traceback (most recent call last):
File "main.py", line 1, in <module>
M=int(input())
ValueError: invalid literal for int() with base 10: '2 5'please rectify it:
Write a program to check the overlapping of one string's suffix with the prefix of another string.
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.
Write a C++ Program ,
Create a typedef structure called Doctor that includes medical license (strin g), name of the doctor (string), channeling fee (float) and the number of pa tients checked during the week (int array)
Write a function called getData( ) which is the data type of Doctor that reads the details of Doctor and store them in the variable of the Doctor typedef structure
Hint Use the given function prototype as
Doctor geData (Doctor d);
Write a function called calDocFee( ) which takes three parameters, channel fee of the doctor, number of patients channeled in a week (7 days) array and the size of the array. Find the total charges for channeling of the doctor and print the total channeling fee
Call the getData( ) and calDocFee( ) functions in the main function to print the following output as required
how to print vowels and consonants and spaces are not counted