Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me with this assignment C++ data structure Need the code as copy and paste in visual studio CS-303 Assignment 1 (25 points) Input

Please help me with this assignment C++ data structure Need the code as copy and paste in visual studio

image text in transcribed
CS-303 Assignment 1 (25 points) Input file: h .box.com/s 01n0hrmq095vBkvazdnuideary1 e8i2j Q1) (20 points) Write a C++ program that can read data from an input file (link is provided above) into a one dimensional array (don't use vector) and perform the following functions: 1) A function to check if a certain integer exists in the array if the number s present return the index where the number is present. 2) A function that can modify the value of an integer when called with the index of the integer in the array and return the new value and old value back to the user. 3) A function that adds a new integer to the end of the array 4) A function which intakes an index of an array and replaces the value with either 0 or removes the integer altogether. Q2) (5 points) A way to indicate an error, especially if there are several possible errors in code, is through the use of exceptions. Exceptions are used to signal that an error has occurred. You can insert code in your program that throws an exception when a particular kind of error occurs. An exception handler allows the user to catch or handle the exception. To avoid uncaught exceptions, you write a try block that can throw an exception and follow it with a catch block that catches the exception and handles it. Using the array code from question 1 perform the following: 1) Add a try and catch blocks to the user inputs for the following functions from question 1: * Afunction that can modify the value of an integer when called with the index of the integer in the array and return the new value and old value back to the user. * Afunction that adds a new integer to the end of the array Submission guidelines: 1) You should have a header file and -cpp file. The header file should provide the function \\ declaration and .cpp file should have implementation details. ' 2) Allthe functionality of the program should be implemented as functions and methods. 3) The code should be well commented 4) Create areport (readme file) that contains instruction on how to run the code and screen shots of the outputs 5) Upload your report and code files to GitHub. 6) Submit the GitHub link on Canvas by due date. W Alinput.txt 12345678910 111213141516 17 18 19 20 21222324 252627 28 29 30 31323334353637383940 4142 43 44 45 46 47 48 49 50 515253 54 5556 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71727374757677 78 79 80 81 82 83 84 85 86 87 88 89 90 9192 93 94 9596 97 98 99 100

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Programming questions