Prototype in header file:** In code/vector3D.h

For this assignment, you will create the following files. You will submit them by pushing it to your Github repository for class.
0. **readme.md** a readme markdown file (provided)
1. **code/vector3D.c** where you will put your function definition
2. **code/vector3D.h** where you will put your function prototype and struct definition
3. **code/Makefile**
4. **code/main.c** where you will define a main program that runs some tests of your functions
5. **writeup/writeup.pdf** where you will write up your results
6. **writeup/references.pdf** where you will write a list of your collaborators and any references you used.

2. **Define a 3D vector struct:** Define a struct called vector3D in code/vector3D.h. The struct should have 3 float values (called x, y, and z).

2.5. Reminder: commit your changes.

3. **Define prototype in header file:** In code/vector3D.h, define the prototype of a function called norm that calculates the Euclidean norm $$\sqrt{x^2 + y^2 + z^2}$$ of any vector with 3 entries. The output should be a float, and the function should take one input: a vector3D struct.

4. **Implement the norm:** In code/vector3D.c, implement the function called norm, using the same input and output types as specified in the corresponding prototype. Note that you’ll need to use the standard math library and include the math header file to call the function that calculates a square root.

4.5. Reminder: commit your changes.

5. **Write a test:** In code/main.c, write a main program to:
* Create a vector3D struct called aVec which has (1, -4/3, 0) as its (x,y,z) components.
* Calculate n, the Euclidean norm of aVec. Print out “Output of norm function, n is ” followed by the n value you calculated. We know from pencil-and-paper math that $$\sqrt{(1)^2 + (-4/3)^2 + (0)^2} = 2$$. (Writeup question #1: What does it output?)
* Print out “Is n exactly equal to 5/3?” followed by the boolean result of checking exact equality of 5.0/3.0 and n. (Writeup question #2: What is the result? Why might that be?)
* Print out “Difference between n and 5/3 is ” followed by the difference between 5.0/3.0 and n, being sure to use scientific notation with %.10e formatting when you print it out. (Writeup question #3: How large is the difference between 5.0/3.0 and n? Explain why this does or doesn’t make sense.)

5.5. Reminder: commit your changes.

6. **Makefile rule to compile:** In code/Makefile, write a rule called **buildMain** to compile the code using the gcc compiler with no optimizations and output a binary called main. You’ll need to include the flag for the math library. (Writeup question #4: Draw a diagram on less than half a page illustrating what the compiler does with main.c, vector3D.c and vector3D.h) Before moving on to step 7, first make sure that your code compiles.

7. **Makefile rule to run tests:** In code/Makefile, write a rule called **run** to run the main test and print out results to the command line.

7.5. Reminder: commit your changes.

8. **References:**  In writeup/references.pdf make a list of any references you use and any collaborators you worked with (no matter if you helped them or they helped you). Note that you must also include a comment on any line of code that is based on code from class or a reference.

Hint: on the writeup and references documents, don’t just make a .txt file then rename it to .pdf. Literally make a pdf on your computer that can be opened with a pdf viewer, then add those to your repo.

9. **Writeup:** In writeup/writeup.pdf answer the 4 writeup questions using complete sentences.

9.5. Reminder: commit your changes and **don’t forget to push**! Delete all executable files.

10. **Submit:** You should have been committing code changes regularly. Go to the GitHub website those changes are pushed to GitHub and that your repository is linked to the course’s GitHub Classroom.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your paper today and save 30% with the discount code HAPPY

X
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 323 412 5597

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 30% with the discount code HAPPY