Write a class Polynomial that stores a polynomial

Assignment Help C/C++ Programming
Reference no: EM131854231

Homework 1 - C++ II Programming

A salesperson enters sales in a text file. Each line contains the following, separated by comas: The name of the client, the service sold (such as Dinner, Conference, Lodging, and so on), the amount of the sale, and the date of that event. Write a program that reads such a file and displays the total amount for each service category. Display an error if the file does not exist or the format is incorrect. The application should write separate files for each service category, containing the entries for that category along with descriptive statistics for that category (Min, Max, Range, Average, Std. Dev, and Variance). Name the output files Dinner.txt, Conference.txt, and so on.

Specifications -

The only user input required is the name of the input file.

Create a class that models a specific sale (name of client, service, amount, and date).

Create a class Sales that contains a vector or array of objects of the class defined above).

This class should have methods to filter the data, determine the stats for each type, etc.

The program should round results to two decimal places.

The program should display to the user the name of the files and the totals for each category.

Create a text file with 10,000 entries (you can use excel to generate random data)

Documentation - No document is required for this assignment, but make sure you document your code completely - that includes all comments for methods, attributes, etc...

Submitting your program -

You will submit this assignment on blackboard. You are allowed one submission. Submit your .cpp & .h files (not your entire project) and your input / output files.

Homework 2 - C++ II Programming

Write a class Polynomial that stores a polynomial such as

p(x) = 5x10 + 9x7 - x - 10

as a list of terms. A term contains the coefficient and the power of x. For example, you would store p(x) as a list like -

(5, 10), (9, 7), (-1, 1), (-10, 0)

Supply member functions to add, multiply, and get the polynomial as a string such as

p(x) = 5x^10 + 9x^7 - x - 10

Supply a constructor that makes a polynomial from a single term. For example, the polynomial p can be constructed as

Polynomial p(Term(-10, 0));

p.add(Polynomial(Term(-1, 1)));

p.add(Polynomial(Term(9, 7)));

p.add(Polynomial(Term(5, 10)));

Then compute the product by -

Polynomial q = p.Multiply(p); // or p * p;

cout << q.ToString(); // or cout << q;

Or the user can use the operators + and * as well as << to add, multiply, and display the polynomial.

Specifications -

Use the list or linked list data structures we created in class - modify them as needed to work with your polynomial.

Create a class Polynomial and Term.

Overload operators as necessary to solve the problem. At a minimum you will need the +, *, and << operator for the polynomial class.

Provide internal helper methods as needed to solve the problems of addition, multiplication, and converting to a string.

Document the running times of your operations (add, multiply, and string conversion) - be sure to explain in detail how the running time is determined.

Documentation - No document is required for this assignment, but make sure you document your code completely - that includes all comments for methods, attributes, etc...

Submitting your program - You will submit this assignment on blackboard. You are allowed one submission. Submit your .cc & .h files (not your entire project) and screenshots of your code running.

Reference no: EM131854231

Questions Cloud

Explain between-groups variance and within- groups variance : Discuss which analysis of variance should be applied when an experiment has more than one independent variable.
Write a summary of the article diversity rules : Write a summary of the article - Validation, Verification, and Testing: Diversity Rules by Barbara Kitchenham and Steve Linkman
How you would address transitioning from being a member : how you would address transitioning from being a member of a collective bargaining unit to being a manager who cannot be a member of collective bargaining unit.
Discuss a preschool classroom and a classroom for children : Discuss a preschool classroom and a classroom for children five years old or more. (Please share at least five sentences.)
Write a class Polynomial that stores a polynomial : Write a class Polynomial that stores a polynomial. Create a class Polynomial and Term. Overload operators as necessary to solve the problem
Classify the budget in terms of objects of expenditure : classify the budget in terms of objects of expenditure. link specific outcome measures to requests for funds.
Identify ethical issues that need to be addressed : What would you advocate for? Identify ethical issues that need to be addressed when working with these individuals.
Conduct a person-oriented job analysis : Conduct a person-oriented job analysis that discusses at least one attribute for each of the following categories: (1) knowledge, (2) skills, and (3) abilities.
Prepare journal entries required to record bond retirement : Prepare the complete amortization table. Prepare the journal entries required to record the bond retirement.

Reviews

len1854231

2/8/2018 2:06:50 AM

Some items to consider before you start writing your programs: All programs will be graded based on the criteria listed below using the rubric below. After each assignment is submitted solutions will be placed on Blackboard. Take the time to review those solutions as they act as an example of a program that would receive a high score. Program Specifications / Correctness - A program must meet its specifications and function correctly. Programs should behave as desired and produce the correct output, for a variety of inputs. This criterion includes the need to meet specifications by writing a program in a particular way or using a particular language feature, if such a thing is mentioned in the problem.

len1854231

2/8/2018 2:06:44 AM

If a specification is ambiguous or unclear, you have two choices: You can either make a reasonable assumption about what is required, based on what makes the most sense to you, or you can ask the instructor. If you make an assumption about an ambiguous specification, you should mention that in the header comments so that I know what you were thinking. Points may be taken off for poor assumptions, however.

len1854231

2/8/2018 2:06:39 AM

Readability: A theme in this class: There is more to programming than whether or not the program runs! Code must be readable to both you and a knowledgeable third party. This involves: First and foremost – you must follow the prescribed coding conventions that are discussed in class and that are codified in the resources given. That also means being consistent on those items that are not explicitly delineated in the given resources. The following list is a list of some items to consider (not comprehensive). Using indentation consistently (e.g., every function's body is indented to the same level). Adding whitespace (blank lines, spaces) where appropriate to help separate distinct parts of the code (e.g., space after commas in lists, blank lines between functions or between blocks of related lines within functions, etc.)

len1854231

2/8/2018 2:06:34 AM

Giving variables meaningful identifiers. Variables identified as A, B, and C or foo, bar, etc… give the reader no information whatsoever about their purpose or what information they may hold. Identifiers like principal, maximum, and counter are much more useful. No magic literals in the code (e.g. count < 5) Magic literals should be avoided! The code should be well organized. Functions / classes should have meaningful identifiers.

len1854231

2/8/2018 2:06:29 AM

Documentation: Every file containing code must start with a header comment. At the very least, this header should contain the name of the assignment / project, a description of what the included code does, and the name of its author (you), the date it was written, and possibly a more detailed description of the approach used in the code, if it is complex or may be misunderstood, be sure to include references to resources that you used to help you write it.

len1854231

2/8/2018 2:06:22 AM

All code should also be well-commented. This requires striking a balance between commenting everything, which adds a great deal of unneeded noise to the code, and commenting nothing, in which case the reader of the code (or you, when you come back to it later) has no assistance in understanding the more complex or less obvious sections of code. In general, aim to put a comment on any line of code that you might not understand yourself if you came back to it in a month without having thought about it in the interim. As the semester progress mandatory comments will be discussed and you will be required to add them to your code (e.g. javadoc, phpdoc, xml comments. Etc…) Assignment Specifications: Assignments will usually contain specifications and/or requirements outside of the programming problems themselves. For example, the way you name your files to submit them to the course website will be specified in the assignment. Other instructions may be included as well, so please read the assignments carefully.

len1854231

2/8/2018 2:06:14 AM

No errors, program always works correctly for all expected input. The code meets all the specification(s) following the instructions and methodology given. No errors, code is clean, understandable, and well-organized. Code is consistent and follows all coding conventions. All required comments are present and complete. Document is included and is complete.

len1854231

2/8/2018 2:06:08 AM

NOTE as a special case, if a program does not meet the specifications at all / is entirely incorrect (submitted the wrong solution, solved another problem than the one assigned, etc…), no credit will be given for the assignment. Ethics: The following are stated as General Standards of Ethics, and may result in changes in a score if these guidelines are not followed: Students are encouraged to share ideas and get assistance from one another, but each student must submit his/her own unique solution to the problem. Any students submitting work that is too similar will receive not receive credit for the work. Do not steal code from the internet, a simple search will revel stolen code and result in a zero (0) for the assessment.

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd