subject
Computers and Technology, 28.05.2021 14:20 kdlishs

PE09 - Classes and Overloaded Operators Implement the class Point3D. Put the class definition in the header p1.h and the implementation in the p1.cpp file. You may not have any inline functions defined in the header file. Use the file xercise. cpp to check if your implementation is syntactically correct.
Your class has three data members: x, y, and z, which are double.
The working constructor supplies values for x, y, and z: all doubles in that order. There is no default constructor.
Create accessors getX(), getY(), getZ(), and magnitude(), which returns the square root of the sum of the squares of all members. (Square each member, add up the squares, return the square root of that.)
Create a mutator normalize() which sets magnitude to 1.0 by dividing each member by the (pre-mutated) magnitude. (1. call magnitude and save. 2. divide each member by that value)
Write a toString() member function that returns the Point3D in this form:
Point3D(x->2.45, y->7.90, z->12.15)
Notice that there are 2 decimals displayed for each value.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 10:00
Hey i just logged on and one of the moderators deleted a bunch of my answers to questions, even though the answers were right and the people it doesn't make sense but if anyone wants to talk about anything just message me lol (this is super random lol)
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
Brian wants to conduct an online search with a certain phrase. he intends to use the words books that belong to the 1800s in his search. how should he use the word that in his search?
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
What social factors affect your health
Answers: 3
question
Computers and Technology, 24.06.2019 01:30
How would you cite different books by the same author on the works cited page? moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. –––. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. –––. folk songs and ballads. salem: poetry press, 1999. print.
Answers: 2
You know the right answer?
PE09 - Classes and Overloaded Operators Implement the class Point3D. Put the class definition in th...
Questions
question
Mathematics, 20.09.2019 03:10