Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Ada programming language Write a program in Ada to perform arithmetic operations on two polynomials. 1. Create an Ada package , polylink to deal

In Ada programming language

Write a program in Ada to perform arithmetic operations on two polynomials.

1. Create an Ada package, polylink to deal with the input, output and storage of the polynomials using linked lists. The required two subprograms are:

The subprogram readPOLY() which reads and stores a polynomial.

The subprogram writePOLY()which outputs a polynomial to screen. Due to the fact that it may be hard to do subscripts, the polynomial could be output in a form like this:

3x^5 - 2x^3 + x^2 + 4

2. Create an Ada package, polymath, which includes subprograms to perform polynomial arithmetic.

The subprogram addpoly(a,b), which adds two polynomials together, i.e. a+b.

The subprogram subpoly(a,b), which subtracts one polynomial from another, i.e. a-b.

The subprogram multpoly(a,b), which multiplies one polynomial by another, i.e. a*b.

3. Create a main wrapper program, poly.adb, which allows the user to interact with the two packages above, reading in polynomials, manipulating them, and outputting them. Ideally interaction would be menu driven.When a polynomial is input, it should be printed to the screen for the user.

When an arithmetic operation is performed, the result should be printed to the screen.

4. Design a good user interface that is intuitive for the user.

NOTE:

Note that each package should include both a .ads and a .adb file.

You can add any addition subprograms or packages that you deem necessary for the functioning of the program. For example, you might want to store the data structure for the linked list in a separate module, as it is required by both the main program and the packages.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions