C++ Question: The first image is the assignment given, and the second image is s
ID: 3874765 • Letter: C
Question
C++ Question: The first image is the assignment given, and the second image is sample code for the assignment's solution. There are different ways to solve the problem in the assignment. Explain in FULL detail the reasons WHY one would solve the problem the way they did.
(20 points) TASK3: Write a program which initializes 2 dynamic arrays of floats Arr_a and Arr_b. Arr_C is a dynamic array as well The user will input values to place into Arr_a then Arr_b. The program will then append into Arr_c the elements from Arr_b, then append into Arr c elements from Arr_a. The program will finally output the contents of Arr_c. Attach Snipping Photo of Source Code and Output belowExplanation / Answer
As far as the given code is concerned, it does exactly stepwise what is asked in the
question.Yes given a problem , there are different ways of coding.Every programer
developes his or her own algorithm to solve the problem. Lot of times algorithm
decides the kind of data structures to be used. In may cases programmers think of
data first and then the operations.So in such cases data structures have a very influence on the algorithm and implementation.Talking about implementation also, an algorithm
can get implemented in various ways depending on the programmer's implementation.
But yes there are always best practices and coding guidelines present to bring
uniformity in the coding or programming.Also there are different types of constraints like memory constraints and performance constraints or other tecnology level constraints that may influence the algorithm design and implementation.So overall there is no
exact reason to adopt a particular style or to say one implementation is better than'other implementation but it all boils down to programming requirements and varies
case to case basis.Ofcourse there are generic priciples for good algorithm design and good implementation and coding styles which should be followed to the extent possible.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.