as6b.c - #include#include#include#include char int char...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> char copen(char a[]) int* print(char a[], int *b) char printR(char a[]) void evaluate(int *arr, int polynum, int val) void add(int *a, int b, int c) void printanswer(struct node *a) void multiply(int *a, int b, int c) struct node { float constant int power struct node *next } int main() { char filename[200], choice1, choice2 = 'Y', choice3 = 'Y' int *a = NULL, choice4, choice5 while(choice3 == 'Y' || choice3 == 'y') { printf("Enter the file where polynomials are found:\n") scanf("%s", filename) choice2 = copen(filename) while (choice2 == 'Y' || choice2 == 'y') { printf("The polynomials available for operation are\n") a = print(filename, a) printR(filename) printf("What operation would you like to perform?\n1. ADD polynomials\n2. Multiply polynomials\n3. Evaluate polynomial\n\nE n choice1 = choice1 - '0' switch(choice1) { case 1: { printf("Enter the polynomials that you would like to work with\n") add(a, choice4, choice5) break } case 2: { printf("Enter the polynomials that you would like to work with\n") multiply(a, choice4, choice5) break
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Sheet1 Page 2 } case 3: { int poly = 0 int eval = 0 printf("Enter the number of polynomial you wish to use: ") printf("\nEnter the value of x: ") evaluate(a, poly, eval) break } default: { printf("Invaild Entry. Please Try Again.") } } printf("Do you want to perform additional operations on the existing file (Y/N)?\n")
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 16

as6b.c - #include#include#include#include char int char...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online