Programming does not always happen smoothly, sometimes a lot of patience, devotion and perseverance are required to solve programming problems and stumbling blocks on your way of creating a new programming solution.While developing an application you might come across a number of programming questions the answers to which are not easy to be found. To spare yourself the trouble, submit your programming questions here and you will get programming answers within the shortest time period.

Learn more about our help with Assignments: Programming

Add two polynomials

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

Output

Print the addition of polynomials A and B.

If the degree of polynomial is zero and the constant term is also zero, then just print 0 to represent the polynomial.

For term Cix^Pi, if the coefficient of the term Ci is 1, simply print x^Pi instead of 1x^Pi.Explanation

Hint:-

We can use dictionaries to maintain polynomial coeffients and powers.

Test Case 1:-

Input:-

6

0 -20

1 23

2 30

3 19

4 6

5 17

9

0 -100

5 -89

6 -20

7 -1

1 20

2 4

3 99

4 -45

8 12

Output:-

12x^8 - x^7 - 20x^6 - 72x^5 - 39x^4 + 118x^3 + 34x^2 + 43x - 120

Note :- Need Space between - and + operators

Test Case 2:-

Input:-

4

0 5

1 0

2 10

3 6

3

0 1

1 2

2 4

Output :-

6x^3 + 14x^2 + 2x + 6

Note:- Need Space between - and + operators

Test Case 3:-

Input:-

5

0 -2

3 6

4 7

1 -3

2 -1

5

0 1

1 2

2 -4

3 3

4 5

Output:-

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

Note:- Need Space between - and + operators

We need all test cases can be came when code was run

Code a program to get the number of students and the group size from the user. Calculate and display the number of groups that must be used to divide the students in the given group size. The last group would possibly not be filled. Display also the number of students in the last group.

Functions to code and use:

**CalcNumberGroups**. This function must get the number of students and the group size via parameters. It must calculate and return the number of groups (integer) that would be used.**CalcLastGroupSize**. This function must get the number of students and the group size via parameters. It must calculate and return number of students (integer) in the last group.

Example:

If there are 23 students and they must be divided into groups of 6, then there will be 4 groups. The last group will have 5 members.

the logical structure in which one instruction occurs after another with no branching in java

**DogCare**. Include fields for a dog’s data (using Dog class from question 1), the date (using **Date** class from question 4), the time (using **Time** class