Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

add 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.

Please help me for this i am not able to do this


3. Disarium Number


A number is said to be Disarium if the sum of its digits raised to their respective positions is the number itself.


Example:

75

7^1+5^2=7+25=32 → False


135

1^1+3^2+5^3=1^9+125=135 → True


Print True if a number is a Disarium, otherwise print False.



Input

The Input will be any integer


135



Output


True


add 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.

How to print 0 in the code for this question since i am trying this question from last 1 mnth i am not passing test casses please help me to do this


Compare python and c++ programming base on your experience. Minimum of 200 words


Develop a program to read the name, birthday and gender of a person from a file and output the name and ten-digit identity card (NIC) number to another file , each name starting on new line (see
example below)The only input to the program is the name of the file. output is the file "output.txt".
rules
The first 4 digits of the ID card is the birth year.
The next 3 digits are the number of days to the birth date from January 1st of that year. If the person is a female, 500 is added to that value.
The next three digits are assigned to submission for a particular birth year. input file contains the records of submission where each attribute is space separated.
In example , Aruni is the second entry in year 1990. Therefore the last three digits of NIC are 002.Assume there are only 999 entries per year.
Example:
Input file output file
Saman 1990-05-03 M Saman 1990123001
Aruni 1990-04-06 F Aruni 1990596002
Nazar 1997-09-24 M Nazar 1997267001
Write a program to count Vowels and Consonants in string.

Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more books and offers 2 free books with every purchase of 8 or more books. It offers regular customers 1 free book with every purchase of 7 or more books, and offers 2 free books with every purchase of 12 or more books. Write a statement that assigns freeBooks the appropriate value based on the values of the boolean variable isPremiumCustomer and the int variable nbooksPurchased.


the out put should be 12x^4 + 9x^3 - 5x^2 - x - 1 but our code does not give this out put




Given two polynomials A and B, write a program that adds the given two polynomials A and B.


Input

 5

0 -2

3 6 

4 7

1 -3

2 -1

 5

0 1

1 2

2 -4

3 3 

4 5


Your Output

12x^4 + 9x^3 - 5x^2 - 1x - 1

Expected

12x^4 + 9x^3 - 5x^2 - x - 1



Please Find Error


Given two polynomials A and B, write a program that adds the given two polynomials A and B.Input


Input

7

0 2

1 3

2 1

5 0

3 6

4 7

6 -9

5

0 1

2 4

3 0

1 0

4 -5


Your Output : - 9x^6 + 2x^4 + 6x^3 + 5x^2 + 3x + 3
Expected: -9x^6 + 2x^4 + 6x^3 + 5x^2 + 3x + 3


I need exact output like this expected output and I want to pass each and every testcase for this program






LATEST TUTORIALS
APPROVED BY CLIENTS