Copyright © – Sudharsan Iyengar
CS – 250. Individual
Programming Assignment: #1. Due
Date: 2/5/2017
2-Variable Polynomials:
Dept. collaboration policy applies to this assignment. Work entirely on your own!
You are required to write an application that will manage polynomials that have two variables operations. A polynomial is made up of multiple terms of the form
of the form
Ak
* Xi * Yj Where
Ak are constants, Xi represents X to the power i and Yj
represents Y to the power j.
Your application will open a text file – poly.dat. The first line will contain the number of polynomials described. Each line after that has the number of terms, followed by the terms – constant, power of X and power of Y.
Example: 3
2 5 2 2 3 1 0
5 3 2 2 4 2 1 4 1 2 5 1 1 8 0 0
1 8 3 3
This file describes 3 polynomials;
The first polynomial has 2 terms and is 5 * X2 * Y2 + 3 * X
The second polynomial has 5 terms and is 3 * X2 * Y2 + 4 * X2 * Y + 4 * X * Y2 + 5 * X * Y + 8
The third polynomial has 1 term and is 8 * X3 * Y3
Write an application that will create and store polynomials and provide user with menu driven options to choose polynomials, and perform operations on those polynomials (and output the result), repetitively until the user chooses exit.
Output the chosen polynomial
Evaluate the chosen polynomial (requests the value for X and Y).
Polynomial additions
Polynomial subtractions
Polynomial multiplications
You can output the terms of the polynomial as 5 * X^2 *Y^2 (instead of superscripts). Assume the degree of X and Y is no more than 10. Similar terms should be added into one term.
In the Comment part of your code you must include the following
Your name, the assignment number for this program
Write a problem description that defines your application.
A sample of inputs values and corresponding expected output values
Pseudo-code for the steps your application will execute to achieve its goals
Test your program for various possible input data files. Your program must run for any valid test data file.
You should export
your project to your folder for this class by midnight at the end of the due
date.