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

Polynomial



Given polynomial,write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1+....+C1x+C0 format.



Input



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



Sample Input 1


5


0 2


1 3


2 1


4 7



Sample output 1


7x^4 + 6x^3 + x^2 + 3x + 2



Sample input 2


4


0 5


1 0


2 10


3 6



Sample output 2


6x^3 + 10x^2 + 5

You are required to develop a simple result sheet generator for an Advanced level class.


Assume that class consists of 30 students and each student follows a subject. Implement your


result sheet generator as a menu driven C++ application. Your program should read 30 students


marks from the keyboard and print mark, grade sheet and summary sheet as per the details


given below.


i. Draw a top-level design diagram for the above problem.

Write a recursive method named series (int a, int n) that takes as a parameter an integer that may compute the following series:

-2, 7, 52, 2702… if a = -2 and n = 4


Then, write a full program to solve the above problem using recursion.


Write a query to create a view that shows the average and total orders for each salesman after his or her name. (Assume all names are unique)

 

R1: Salesman

salesman_id | name | city | commission

-------------+------------+----------+------------

5001 | James Hoog | New York | 0.15

5002 | Nail Knite | Paris | 0.13

5005 | Pit Alex | London | 0.11

5006 | Mc Lyon | Paris | 0.14

5007 | Paul Adam | Rome | 0.13

5003 | Lauson Hen | San Jose | 0.12

We now write the subclasses of Item to represent the actual multimedia items (viz.






CDs (music) and DVDs (movies)) we store. There are two issues to consider for






these subclasses:






• Note the rules for constructors require a call to the superclass constructor.






The idea is to call the superclass constructor to initialize the fields in the






superclass.






• Use overridden methods for subclass specific behaviour. In particular we






need to override the toString method as this is different for each subclass.






We will also override the depreciate method since each item depreciates






differently.











Write a class called Item. The Item class represents all that is common between



various multimedia items. It should have the following attributes (fields):



a) a String name to store the name of the item.



b) a String comment to store a comment about the item.



c) a double value to store how much the item cost.



It should have appropriate constructors and at least the following methods



a) getters and setters for the attributes.



b) a public String toString() method that returns a String representation of the



Item.



c) a method void depreciate() that decreases the value of the item by 5%.

You are required to develop a simple result sheet generator for an Advanced level class. Assume that class consists of 30 students and each student follows a subject. Implement your result sheet generator as a menu driven C++ application. Your program should read 30 students marks from the keyboard and print mark, grade sheet and summary sheet as per the details given below. i. Draw a top-level design diagram for the above problem. ii. Write a method named ‘main_menu ()’ to display the following menu items ----------------------- Result Sheet Generator ----------------------- [1] Add New Student Marks [2] Print Mark Sheet [3] Print Grade Sheet [4] Print Summary Sheet [5] Exit iii. Use an array to store all marks of the 30 students. iv. Write a method to add_new_marks () to add marks for the 30 students.


8. Groupings



by CodeChum Admin




Did you know that you can also reverse lists and group them according to your liking with proper code? Let's try it to believe it.






Instructions:




Create a variable that accepts a positive odd integer.



Create an empty list. Then, using loops, add random integer values into the list one by one. The number of values to be stored is dependent on the inputted odd integer on the first instruction.



Reverse the order of the list. Then, print out the list's new order in this manner:



[first-half values]-[middle value]-[second-half values], just like that of the sample output. Make use of list slicing that you’ve learned from the past lessons to easily achieve this segment.



Input




The first line contains an odd positive integer.



The next lines contains an integer.




5



1



3



4



5



2



Output




A line containing a list.




[2,5]-[4]-[3,1]

7. Arraying 102



by CodeChum Admin




We've already made arraying/listing the easy way, but how about arraying/listing and printing the list in reverse order?






Make a program that will input an integer and then using loops, add items on an array/list one by one for the same number of times as that of the first inputted integer. Then, print out the array/list in reverse order, that is, starting from the last item on the array/list down to the first one, each in separated lines.




Input




The first line contains the size of the array/list.



The next lines contains the items of the array/list (integers).




5



1



64



32



2



11



Output




Multiple lines containing integers.




11



2



32



64



1

6. The GCD



by CodeChum Admin




The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers.






Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as well.




Off you go!




Input




A line containing two integers separated by a space.




6·9



Output




A line containing an integer.




3

LATEST TUTORIALS
APPROVED BY CLIENTS