Patterns留学生作业代做、代做Collapse Hierarchy作业、代写c/c++,Python,Java编程语言作业代做R语言编程|代写Datab

Assignment 4: Refactoring and PatternsYou work for an educational software company that is developing a suite of simple Physicssimulations. The code in pendulum.zip is the beginning of a suite intended to permit the creation ofa series of different types of pendulum simulation. You previously identified a code smell (“triviallayer”) in the AbstractEarthPendulum class, but figured it was mostly harmless. Now yourteam wants to be able to dynamically set which planet a pendulum is on during an interactivesimulation, and to allow different kinds of gravity models that are impossible to represent with asingle constant (e.g., latitude models).1. Run the main/test routine to see the expected behavior of the code.2. Apply the refactoring approach “Collapse Hierarchy” to reduce the hierarchy levels by one.Ensure that the main/test routine still works as expected. Make a copy of all the code in a foldercalled “RefactoringStep1”3. Next, use the Strategy design pattern (shown below) to replace the field g with a reference to astrategy object (as outlined below). This will allow different kinds of gravity models to be associatedwith a Pendulum instance dynamically.Name the strategy interface GravityModel, with a single methodpublic double getGravitationalField ();Assume that objects implementing GravityModel will be initialized with all state required toproduce the gravitational field value under their specific model, and that this occurs before beingassigned to a pendulum. In other words, the pendulums will just use the model assigned to it via theGravityModel interface. Adjust the pendulum constructors so that a GravityModel isassigned on initialization, and add a new method that will allow the GravityModel to be changeddynamically.Define one concrete strategy called GravityConstant. This class simply receives a constantvalue for g in its constructor.4. Run the main/test routine to ensure that the functionality hasn’t changed. Copy all the code into afolder called “RefactoringStep2” 5. Modify the provided main/test routine so that it initializes a SimplePendulum and aRegularPendulum with a GravityConstant object, lets the pendulums swing for a littlewhile, then assigns a different GravityConstant object. For example, your firstGravityConstant could represent the Earth’s gravitational field (9.81 m/s^2), and the secondcould represent Jupiter’s (25 m/s^2).Submit all code (including the 2 refactoring folders and the final version of the code with themodified test) as a single zip file on Brightspace.Marking Scheme for A4 (20 marks):Rubric for A4 is not provided prior to the deadline.本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp

QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(Patterns留学生作业代做、代做Collapse Hierarchy作业、代写c/c++,Python,Java编程语言作业代做R语言编程|代写Datab)