EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考




您的位置: 主页 > 理科代写案例 > 物理代写案例 >
物理代写:物理physics作业代写,assignment代写,考试代考 - 物理作业代写/物理代考
发布时间:2021-07-25 17:54:54浏览次数:
 DO NOT look at anyone s code other than your own, including code from another sstudent in your section or another section of the course, or any third party source, e.g.the Internet DO NOT share or copy anyone else s code for any graded assignment DO NOT work in pairs or groups All cases of academic misconduct will be reported to the Committee On AcademicMisconduct (COAM).Setting up the Programming EnvironmentEffective commenting and tabbing will affect your grade. The style of your program shouldfollow the style of the sample programs in the lecture notes. Also see the example code from Lab#1. Your program should have the file name, your name, creation and last modification dates anda brief description of the program in the comments. In addition, read the document on Commenting found in the Content tab on Carmen under Tutorials .1. At the Linux command line type mkdir lab12. This will create a new directory namedlab12. Work out of this directory. In order to do that, type cd lab12. This changes thecurrent working directory to the directory lab12.2. If you have created the directory lab12, then just type cd lab12.3. Copy the file triangles_template.cpp by typingcp /class/cse1222/34462/lab12/triangles_template.cpp triangles.cpp4. Copy the file triangles_solution.exe into the current directory.cp /class/cse1222/34462/lab12/triangles_solution.exe .Be sure to include the word 34462 (this is your course section indicator) and the period, . .Programming AssignmentWrite a program that will represent an axis-aligned right triangle in the x-y plane as a Class. Aright triangle has a right angle (90-degree angle) and two sides adjacent to the right angle, calledlegs. See for a complete definition. In addition, anaxis-aligned right triangle has one leg parallel with the x-axis and the other leg parallel with they-axis. The location of the triangle is the vertex that connects the two legs, called the bottom leftvertex. This vertex is located at the right angle and represented with the Class Point. The lengthCSE1222 Autumn 2017CSE1222 Lab 12 2of the triangle is the length of the leg parallel with the x-axis. The height of the triangle is thelength of the leg parallel with the y-axis.The procedure main() (see the code template triangles_template.cpp) has been writtenfor you as well as the member attributes of the Class Triangle. You will write code for themember functions of the Class Triangle as indicated by the comments /* INSERT CODE HERERun triangles_solution.exe to see an example of the program.1. The function prototypes are provided for you and must NOT be changed in any way.2. The get and set member functions of the class Point are already written for you.3. The procedure main() is provided for you and must NOT be changed in any way.4. Understand the class definitions for Point and Triangle.5. Understand the algorithm in the procedure main().6. Do NOT add more functions to the solution.7. Each function should have a comment explaining what it does.8. Each function parameter should have a comment explaining the parameter.9. Write code by replacing every place /* INSERT CODE HERE */ appears with your solution.10. Implement the get and set member functions for the class Triangle. Use the appropriate classattributes of the class Triangle.a. The location of the bottom left vertex is stored in the member attribute blPoint.b. The top left vertex can be computed from blPoint and the height.c. The bottom right vertex can be computed from blPoint and the length.11. You may assume that the user will enter positive values for the length and height.12. Implement the member function hypotenuse() of the class Triangle that computes thehypotenuse of a triangle object. Use the Pythagorean Theorem to compute the length of theside of the triangle opposite to the right angle. Use the appropriate class attribute(s) of theclass Triangle.13. Implement the member function perimeter() of the class Triangle that computes theperimeter of the triangle object. Sum all three sides of the triangle. Use the appropriate classattribute(s) of the class Triangle and the member function hypotenuse().14. Implement the member function scaleLength() of the class Triangle that computes the newvalue of the length as the current length weighted by the scale factor in the x direction. Forexample, if the current length is 2 and the scale factor is 3, the new length is 6. If the currentlength is 2 and the scale factor is 0.5, the new length is 1. You may assume that the scalefactor will be positive. Update the length class attribute of the class Triangle.15. Implement the member function scaleHeight() of the class Triangle that computes the newvalue of the height as the current height weighted by the scale factor in the y direction. Youmay assume that the scale factor will be positive. Update the height class attribute of theclass Triangle.16. Implement the member function display() of the class Triangle that displays all informationabout the triangle. Use the appropriate class attributes and member functions of the classTriangle. Important note, do not write redundant code.CSE1222 Autumn 2017CSE1222 Lab 12 317. Implement the function read_triangle() that prompts and reads the location of the bottomleft vertex, length and height. These values are assigned into the class Triangle object passedinto the function using set member functions.18. TEST YOUR CODE THOROUGHLY. For example, pay close attention to the format of theoutput including empty lines. Your program must not have a run-time error.19. Be sure to add the header comments File , Created by , Creation Date and Synopsis atthe top of the file. Each synopsis should contain a brief description of what the program does.20. Be sure that there is a comment documenting each variable.21. Be sure that your if statements, for and while loops and blocks are properly indented.22. Check your output against the output from the solution executables provided.Submit Your WorkImportant: Any program which does not compile and run will receive no credit!If you are not sure what this means please ask your instructor.Submit the file triangles.cpp using the Lab 12 drop box on Carmen. DO NOT submit thefile a.out. DO NOT submit uncompleted work from Quiz 11. This will not be graded.