Chat with us, powered by LiveChat COP 3014: Fall 2018 Homework 4Total Points: 200 Due: Friday, 11/16/ | Writedemy

COP 3014: Fall 2018 Homework 4Total Points: 200 Due: Friday, 11/16/

COP 3014: Fall 2018 Homework 4Total Points: 200 Due: Friday, 11/16/

COP 3014: Fall 2018 Homework 4Total Points: 200 Due: Friday, 11/16/2018The objective for this assignment is to make sure You understand and can work with C++ arrays. You are comfortable with writing functions in C++. You are familiar with repetitive structures (loops) and selection statements (if/else or switch) in any combination and can use them in functions and to manipulate array data. You can approach a complex problem, break it down into various parts, and put together a solution.From this assignment, please make sure you conform to Output requirements. You should now be familiar enough with cout statements and output formatting that you should be able to EXACTLY match the sample output (other than certain exceptions you will be informed about beforehand).This assignment requires you to several files on Canvas. Please do so in a SINGLE submission. Canvas allows you to turn in multiple flies in one submission. Once you have uploaded your first file, click “attach another file” to upload your second file and so on.Turn in your 3 files functions.cpp, arrays.cpp and matrix.cpp, (and the extra credit programevaluate.cpp, if you are attempting it) to Canvas.2 Program 1 – Writing Functions – 75 pointsSquilliam Fancyson has heard of the fancy calculator that Squidward (supposedly) made for the Krusty Krab’s Cash Register. Determined to prove that he is the best programmer in town, he has challenged Squidward to a series of programming challenges. If Squilliam wins, Squidward has to hand over his clarinet and never paint again. If Squidward wins, Squilliam will work Squidward’s shift at the Krusty Krab’s cash register for a week. Squidward is determined to win, except he is not really a programmer. He has left no stone (pioneer transport or otherwise) unturned. He has even tried asking Karen, who was unable to help. He realizes that instead of working off Mr. Krabs’ old computer (the one Patrick smashed while painting the house), he could just pay you to do the challenges for him. Your task today is to help Squidward retain his sanity and dignity (whatever is left of it).The first challenge is to write a few mathematical functions. For this program, we define a new term called Special Difference. The Special Difference of a number is the difference between the number and the one you obtain by reversing its digits. For example, the Special Difference of 1234 is 3087 (| 1234 – 4321 |).1We also find the value of ex using the Taylor’s series expansion. The Taylor’s Series expansion of ex is defined ase =Please make sure your program conforms to the following requirements.number. (20 points) Write a function called difference that accepts a number as a parameter, calculates the special difference of the number and returns it. (15 points) Write a function called factorial that returns the factorial of a number. You can use the code from the class examples. Write a function called sum that takes a number ’x’ and a number ’n’ as parameters and calculates ex accurate to the ’nth’ term. You cannot just raise e to x. You have to use the expansion to calculate the value. (20 points) You can use the pow function to calculate xn. In the main function, accept a series of numbers from the user. Stop if the number entered is negative. Use the difference method to find the sum of the special differences and print it. (10 points) Next, still in the main function, accept the values of ’x’ and ’n’ from the user and use the sumfunction to calculate the required value and print it. (5 points) Make sure you add comments to explain your logic. (5 points)2.1 Sample RunCalculating the Special Differences:Enter the numbers:123457982603-2The Sum is 4095Calculating e^x through Taylor’s Series Expansion:Enter the value of x: 5Enter the number of terms: 20e^x is 148.4133 Program 2 – Array Operations – 75 PointsSquilliam has been soundly beaten in the first challenge. He still refuses to give in. It is now a best of 3 challenge. The next item on the agenda is array operations. For this program, we’re going to perform a range of standard array operations to show Squilliam once and for all, that Squidward is familiar with arrays and how they work. You’re required to write functions to insert and deleteinfx ????xn x0 x1 x2 x3n!=0!+1!+2!+3!…1. Write a function called reverse that takes a number as a parameter and returns the reversedn=02elements from an array, and sort the array. We’re also going to write a command line menu to do these tasks repeatedly. For this problem, you can assume that the array size will never drop below 1 and will never rise above 99.Please make sure you conform to the following requirements: Create a global constant integer called CAPACITY and set it to 100 (5 points) Use the class examples and exercises to write functions to initialize the array by reading values from the user, and to print the array. These functions take the array and its current size as parameters. You can use the code in the examples. (5 points) Write a function called insert that takes the array, a number, a position and the current size of the array as parameters. Insert the number at the given position. (15 points) Write a function called remove that takes the array, a number and the current size of the array, and removes the first instance of the number from the array. (15 points) Write a function called sort that takes the array and its current size as parameters and sorts the array in ascending order. You need to use insertion sort, which is given below. (15 points) In the main function, have the user initialize the array. Then, write a command line menu with the following options:• Print• Insert• Remove• Sort• ExitCall the appropriate functions when the user chooses a particular option. Print and error message and continue if the user enters a wrong option. (15 points) Please make sure your code is appropriately commented. (5 points)Algorithm for insertion sortloop i from 1 to Length(A)        x = A[i]j=i-1loop as long as j >= 0 and A[j] > xA[j+1] = A[j]j=j-1 end loop       A[j+1] = xend loop3.1 Sample RunsEnter the number of elements you want to enter (Max 100): 5Enter 5 numbers2.5 6 -7 10.7 0.81. Insert an element2. Remove an element3. Print the array34. Sort the array5. ExitEnter your option: 1Enter the number: 3.1Enter the position: 2Element Inserted.1. Insert an element2. Remove an element3. Print the array4. Sort the array5. ExitEnter your option: 3The array is:2.5 6 3.1 -7 10.7 0.81. Insert an element2. Remove an element3. Print the array4. Sort the array5. ExitEnter your option: 41. Insert an element2. Remove an element3. Print the array4. Sort the array5. ExitEnter your option: 3The array is:-7 0.8 2.5 3.1 6 10.71. Insert an element2. Remove an element3. Print the array4. Sort the array5. ExitEnter your option: 2Enter the element: 0.8Element deleted.1. Insert an element2. Remove an element3. Print the array4. Sort the array5. ExitEnter your option: 3The array is:-7 2.5 3.1 6 10.741. Insert an element2. Remove an element3. Print the array4. Sort the array5. ExitEnter your option: 5Goodbye!4 Program 3 – Matrix Norms – 50 pointsThe competition is heating up. The special judging panel, consisting of Karen, Old Man Jenkins and Sandy, do not want to release the results of the previous challenge until this one is complete as well. For this challenge, you have to compute the Max Norm of a matirx. The Max norm of a ma- trix is defined as the largest elements of a matrix. Write a C++ program to compute the Max norm.Please make sure you conform to the following requirements: Declare global constant integers for ROWCAP and COLCAP. Set both to 100 (5 points) Use the class examples and exercises to write functions to initialize the matrix by reading values from the user, and to print the matrix. These functions take the matrix and its current number of rows and columns as parameters. You can use the code in the examples. (5 points) Write a function called findnorm that accepts the matrix, its current number of rows and columns and return its max norm. (20 points) In the main function, initialize the matrix, read in its values and compute and print its norm. (15 points) Please make sure your code is commented (5 points).4.1 Sample RunEnter the number of rows: 3 Enter the number of columns: 3 Enter the matrix:-3 5 72 16 4028The max Norm is: 165 Extra Credit Problem – Simple Calculator – 50 pointsIn the distant and slightly dystopian future, the Grand Poobah has banned the use of hand held calculators. Some say he was hit on the head with one. Others believe it is due to his fear of accountants. Either way, hand calculators are a thing of the past. However, you find yourself in sudden need of a calculator that can perform simple calculations. No worries. You are a C++ programmer and you can write a console application to do this.This program does not serve any practical purpose and is, in fact, a very inefficient way to de- sign a calculator. This exercise is just to give you some practice in writing functions.5Specifications This program makes use of functions. The main function should only contain one effective line (that is not the usual program stub), which is a call to the evaluate function. (5 points). Write 5 functions to perform the 5 basic arithmetic operations: +, -, *, / and %. Give them some sensible name (for example, the function that performs addition can be called add). Each of the functions will take 2 integer arguments and return an integer value. (25 points) Write a function called evaluate, that does not take any arguments and does not return a value. This function will read in an arbitrary number of values from the user: an integer followed by a character that denotes an operation. Once you have the number and the operation, call the appropriate function from the five that you just wrote to keep a running evaluated total. The user input ends when the character entered is a ‘=’. When the user is done with input, print the result. (15 points) You may assume that all inputs are valid. You need not test for wrong inputs. Here, you need to ignore the order of operations and calculate the values as they come. Please include comments wherever appropriate. (5 points)5.1 Sample RunEnter the expression:1+26*2%19/5=The result is 35.2 Sample Run 2Enter the expression:12*9-37+-8=The result is 636 Generic Guidelines1. Include the header comment with your name and other information on the top of your files.6 Please make sure you’re only using the concepts already discussed in class. That is, please try and restrict yourself to input/output statements, variables, selection statements, loops, functions and arrays. Using any other concept (like pointers) will result in loss of points. You cannot use arrays for Problem 1 and Problem 4. For those, you are restricted to functions, loops and selection statements. The first 2 programs are worth 75 points each. the third program is worth 50 points. Please make sure that you’re conforming to specifications (program name, print statements, expected inputs and outputs etc.). No global variables (variables outside of main() ), excpet for constants. All input and output must be done with streams, using the library iostream You may only use the iostream, iomanip and the cmath libraries (you do not need any others for these tasks) NO C style printing is permitted. (Aka, dont use printf). Use cout if you need to print to the screen. When you write source code, it should be readable and well-documented (comments). Make sure you either develop with or test with Jetbrains CLion (to be sure it reports no compile errors or warnings!) before you submit the program. Program submissions should be done through the Canvas class page, under the assignments tab (if its not there yet Ill create it soon.) Do not send program submissions through e-mail e-mail attachments will not be accepted as valid submissions. TheONLYfilesyouwillsubmitviaCanvasarefunctions.cpp, arrays.cppandmatrix.cpp, (and the extra credit program evaluate.cpp, if you are attempting it). Please make sure you’ve compiled and run your program before you turn it in. Compilation errors can be quite costly (4 points per error,until the 10th error, after which you will be assigned a grade of 0). General Advice – always keep an untouched copy of your finished homework files in your email. These files will have a time-stamp which will show when they were last worked on and will serve as a backup in case you ever have legitimate problems with submitting files through Canvas. Do this for ALL programs.

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Writedemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order