CIS 26 Assignment CIS 27 Fall 2020 – Homework #4 Update #2 – Page 1 of 9 Turn In: 1. Exercise #1 – Due on Thursday, October 22, 2020 by 11:00pm Email Submission a) For the assignment, a package must...

1 answer below »
All on the attached file. Please let me know if it is able to be done before Thursday by 10:30pm


CIS 26 Assignment CIS 27 Fall 2020 – Homework #4 Update #2 – Page 1 of 9 Turn In: 1. Exercise #1 – Due on Thursday, October 22, 2020 by 11:00pm Email Submission a) For the assignment, a package must be generated to include the following items: - Copy of your source file (C program)—your source file MUST BE NAMED as cis27Fall2020YourNameHw4.c - Copy of output (copy and paste to the end of your program as PROGRAM_OUTPUT comment block) - Copy of Logic_Code_Output_Issues (as a separate comment block) after the “PROGRAM_OUTPUT” block. b) Emailing each package as follows, - One email message for each exercise. - The SUBJECT line of the message should have the following line: cis27Fall2020YourNameHw4.c - Attaching the source file that was created in part a). 2. Q.E.D. ***************************************************************************** CIS 27 Fall 2020 – Homework #4 Update #2 – Page 2 of 9 1. Coding Assignment Exercise #1 1. Write a menu program to have the display below, CIS 27 – Data Structures Laney College YourName Information – Assignment: HW #4 Exercise #1 Implemented by: YourName Submitted Date: 2020/10/20 Current Number of LEB available: ? Allowed Number of LEB Used: ? Remaining Number of LEB: ? 2. You are going to work with polynomials that have fraction as coefficients and integers as powers/exponents. The polynomials will be created as linked lists with the information and specifications given below (you should attach YourFirstName in full and YourLastName initial at the end of the structures and functions below – Using my name as examples and discussed in class). /* Homework 4 Preparation -- fractionPolyNode.h*/ // Types and various typedef struct Fraction { int num; int denom; }; typedef struct Fraction TFraction; typedef struct Fraction* TFractionPtr; struct PolyTerm { int expo; TFractionPtr coeff; }; typedef struct PolyTerm TPolyTerm; typedef struct PolyTerm* TPolyTermPtr; struct PolyNode { TPolyTermPtr data; struct PolyNode* next; }; typedef struct PolyNode TPolyNode; typedef struct PolyNode* TPolyNodePtr; //Additional typedef’s typedef struct PolyNode* TPolyNodeAddr; typedef struct PolyNode* TPolyList; typedef struct PolyNode** TPolyListHeadAddr; CIS 27 Fall 2020 – Homework #4 Update #2 – Page 3 of 9 // Function Prototypes TPolyNode* createPolyNode(void); // To Be Discussed and // Updated TPolyNodePtr add(TPolyNode*, TPolyNode*); TPolyNodePtr multiply(TPolyNode*, TPolyNode*); void displayPolyNode(TPolyNodePtr); 3. And, you are supposed to have worked on previous supportive functions to create polynomials. You are going to implement 2 functions named and prototyped as below. TPolyNodePtr addPoly(TPolyNode*, TPolyNode*); TPolyNodePtr multiplyPoly(TPolyNode*, TPolyNode*); 4. Write a menu program to have the above options for the polynomials. Your menu program should not use global data; data should be allowed to be read in and stored dynamically. 5. Name your program as cis27Fall2020YourNameHw4.c Test your output with the data below. Poly #1: {{2, 1/1}, {1, 3/4}, {0, 5/12}} Poly #2: {{4, 1/1}, {2, -3/7}, {1, 4/9}, {0, 2/11}} Make sure that the output is reasonable and detailed enough so that the user would understand the list – Use printf() measurably. Attach the following output at the end of your source code (as comment). ****************************** * Menu HW #4 * * POLYNOMIAL OPERATIONS * * * * 1. Creating polynomials * * 2. Adding polynomials * * 3. Multiplying polynomials * * 4. Displaying polynomials * * 5. Clearing polynomials * * 6. Quit * ****************************** Select the option (1 through 6): 7 You should not be in this class! ****************************** * Menu HW #4 * * POLYNOMIAL OPERATIONS * * * * 1. Creating polynomials * CIS 27 Fall 2020 – Homework #4 Update #2 – Page 4 of 9 * 2. Adding polynomials * * 3. Multiplying polynomials * * 4. Displaying polynomials * * 5. Clearing polynomials * * 6. Quit * ****************************** Select the option (1 through 6): 4 Left Poly Pointer: 0 Right Poly Pointer: 0 Resulting Poly Pointer: 0 ****************************** * Menu HW #4 * * POLYNOMIAL OPERATIONS * * * * 1. Creating polynomials * * 2. Adding polynomials * * 3. Multiplying polynomials * * 4. Displaying polynomials * * 5. Clearing polynomials * * 6. Quit * ****************************** Select the option (1 through 6): 1 /* Performing the required task(s) and your code must ALSO print 1. Description/explanation of the method or approach that you use to create 2 polynomials; and 2. The listing of all functions involved in the process. */ ****************************** * Menu HW #4 * * POLYNOMIAL OPERATIONS * * * * 1. Creating polynomials * * 2. Adding polynomials * * 3. Multiplying polynomials * * 4. Displaying polynomials * * 5. Clearing polynomials * * 6. Quit * ****************************** Select the option (1 through 6): 4 Left Poly Pointer: SOME NONE ZERO ADDRESS and DISPLAYING Poly 1/1x2 + 3/4x + 5/12 Right Poly Pointer: SOME NONE ZERO ADDRESS and DISPLAYING Poly 1/1x4 – 3/7x2 + 4/9x + 2/11 Resulting Poly Pointer: 0 ****************************** * Menu HW #4 * * POLYNOMIAL OPERATIONS * * * * 1. Creating polynomials * * 2. Adding polynomials * CIS 27 Fall 2020 – Homework #4 Update #2 – Page 5 of 9 * 3. Multiplying polynomials * * 4. Displaying polynomials * * 5. Clearing polynomials * * 6. Quit * ****************************** Select the option (1 through 6): 2 /* Performing the required task(s) and your code must ALSO print 1. Description/explanation of the method or approach that you use to add 2 polynomials; and 2. The listing of all functions involved in the process. */ ****************************** * Menu HW #4 * * POLYNOMIAL OPERATIONS * * * * 1. Creating polynomials * * 2. Adding polynomials * * 3. Multiplying polynomials * * 4. Displaying polynomials * * 5. Clearing polynomials * * 6. Quit * ****************************** Select the option (1 through 6): 4 Left Poly Pointer: SOME NONE ZERO ADDRESS and DISPLAYING Poly 1/1x2 + 3/4x + 5/12 Right Poly Pointer: SOME NONE ZERO ADDRESS and DISPLAYING Poly
Answered Same DayDec 01, 2021CIS 27

Answer To: CIS 26 Assignment CIS 27 Fall 2020 – Homework #4 Update #2 – Page 1 of 9 Turn In: 1. Exercise #1 –...

Ria answered on Dec 08 2021
150 Votes
/* Homework 4 Preparation -- fractionPolyNode.h*/
#include
#include
#include <
string.h>
// Types and various typedef
struct Fraction {
    int num;
    int denom;
};
typedef struct Fraction TFraction;
typedef struct Fraction* TFractionPtr;
struct PolyTerm {
    int expo;
    TFractionPtr coeff;
};
typedef struct PolyTerm TPolyTerm;
typedef struct PolyTerm* TPolyTermPtr;
struct PolyNode {
    TPolyTermPtr data;
    struct PolyNode* next;
};
typedef struct PolyNode TPolyNode;
typedef struct PolyNode* TPolyNodePtr;
//Additional typedef’s
typedef struct PolyNode* TPolyNodeAddr;
typedef struct PolyNode* TPolyList;
typedef struct PolyNode** TPolyListHeadAddr;
// Function Prototypes
TPolyNode* createPolyNode(void); // To Be Discussed and Updated
TPolyNodePtr add(TPolyNode*, TPolyNode*);
TPolyNodePtr multiply(TPolyNode*, TPolyNode*);
void displayPolyNode(TPolyNodePtr);
void clearPolyNode();
int main()
{
    int choice;
    TPolyListHeadAddr head;
    
    printf("CIS 27 - Data Structures...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here