辅导EEE102课程程序、 写作C/C++程序

” 辅导EEE102课程程序、 写作C/C++程序EEE102 Fundamental of C++ Assessment 11EEE102 C++ Programming and Software Engineering IIAssessment 1Assessment Number 1Contribution to Overall Marks 65%Submission Deadline Sunday, 14 June 2020, 23:59How the work should be submitted?SOFT COPY ONLY !(MUST be submitted through ICE so that we can run your programs during marking.)Make sure your name and ID are printed on the cover page of your report.Assessment OverviewThis assessment aims at testing some basic concepts of C++ programming and initiates the routine ofcode development using the software development process (SDP), namely the five main steps of thesoftware development process:1. Problem statement: formulate the problem.2. Analysis: determine the inputs, outputs, variables, etc3. Design: define the list of steps (the algorithm) needed to solve the problem.4. Implementation: the C++ code has to be submitted as a separate file. Just indicate herethe name of the file.5. Testing: explain how you have tested and verified your C++ program.You will need to apply this methodology to each one of the following simple exercises.What should be submitted?A short report (up to a few pages of texts plus C++ source codes) detailing for all the questions ofthe assignment. The answer for each question should follow the SDP method:a) Overall quality of report (10%)b) SDP steps 1 to 3. (30%)c) SDP step 4 (implementation): your C++ source code including the comments. (40%)d) SDP step 5 (testing): you will explain how you have tested the correctness of yourC++ program and will include some sample runs of your C++ Programs. (20%).Testing result must be shown by screenshot.The report in either Microsoft Word format (.DOCX file) or PDF format together with C++ sourcecode for all questions should be zipped into a single file. (For maintenance purposes, it isalways a good practice to comment your code as you go. The comments state the aim of theprogram, what are the inputs, what are the outputs, which algorithm is used, who is the authorand so on.)EEE102 Fundamental of C++ Assessment 1 辅导EEE102课程作业、 写作C/C++程序语言EXERCISE 1: OPERATORS AND VECTORS IN C++ (10 POINTS OUT OF 65)Youre now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types: Integer (one rounds score): Directly represents the number of points you get inthis round. + (one rounds score): Represents that the points you get in this round are thesum of the last two valid rounds points. D (one rounds score): Represents that the points you get in this round are thedoubled data of the last valid rounds points. C (an operation, which isnt a rounds score): Represents the last valid roundspoints you get were invalid and should be removed.Each rounds operation is permanent and could have an impact on the round beforeand the round after.You need to return the sum of the points you could get in all the rounds.Note:The size of the input list will be between 1 and 1000.Every integer represented in the list will be between -30000 and 30000.Example:Input: [5,2,C,D,+]Output: 30Explanation:Round 1: You could get 5 points. The sum is: 5.Round 2: You could get 2 points. The sum is: 7.Operation 1: The round 2s data was invalid. The sum is: 5.Round 3: You could get 10 points (the round 2s data has been removed). The sum is:15.Round 4: You could get 5 + 10 = 15 points. The sum is: 30.EEE102 Fundamental of C++ Assessment 13EXERCISE 2: CLASS AND OBJECTS (15 POINTS OUT OF 65)Design a new class to represent a fraction (a ratio of two integer values).The data members of the class Fraction are two integers top and bottom, denoting thenumerator and denominator, respectively.Part 1: Fundamental requirements for the class Fraction.1. Fractional numbers can be declared with both a numerator and denominator, orsimple numerator: (3 points)Fraction a; // represents 0/1Fraction b(3,4); // represents 3/4Fraction c(5); // represents 5/12. Fractions should Be able to act just like other numbers. (4 points)Add, subtract, multiple and divide;Compare based on values;Input and output.Part 2: Advanced requirements3. Reducible fractions (numerator and denominator have a common divisor) should beconverted to irreducible Fractions automatically. (4 points)Example: 10/14 would be converted into 5/7 automatically;4. Write methods to convert between decimals and fractions. (4 points)EXERCISE 3: INHERITANCE (15 POINTS OUT OF 65)Derive a sub-class iFraction from the base class Fraction, which was designed by you inthe above Exercise. The iFraction class represents the mixed fractions likePart 1: Design the sub-class iFraction: (8 points)1. It should have a constructor for initialisation;2. It should contain a method to display the mixed fraction on screen;Part 2: Design an external function convertF (not function member of class Fractionand iFraction) to convert the mixed fractions to improper fractions. (7 points)Hint: convertF can be the friend function of those two classes.EEE102 Fundamental of C++ Assessment 14EXERCISE 4: MATRIX MANIPULATIONS USING THIRD PARTY LIBRARY (10 POINTSOUT OF 65)Eigen ( https://eigen.tuxfamily.org/dox/index.html) is a high-level open-source C++ library oftemplate headers for linear algebra, matrix and vector operations, geometricaltransformations, numerical solvers and related algorithms. Its fast and well-suited for awide range of tasks, from heavy numerical computation, to simple vector arithmetic.Please solve the following problems by using Eigen built-in functions.1. Define two integer type 3*3 matrices, show addition, subtraction, multiplication ofthem; (3 points)2. Define a random 4*4 matrix, obtain and display its transposition, conjugation andtrace, inverse and determinant; (4 points)3. Define a float type 5*5 matrix, show its eigendecomposition. Please use twodifferent solvers. (3 points)EXERCISE 5 (15 POINTS OUT OF 65)This is a computer game with different types of player. Take the code provided for thecontainer class (container.h), player class (player.h) and the swordsman class(swordsman.h), And the main function (main.cpp).Part 1:1. Read the source codes, understand the meaning and fill the blank (shownas ?????????) to make it work; (3 points)2. Generate the CRC cards of the classes: clarify the responsibilities of each class,illustrate the collaboration with others and label all the members as public,protected and private. Then draw the hierarchy chart of them; (3 points)Part 2:3. Design another two classes, archer and mage. Generate their CRC card and putthem in the hierarchy chart drew above. Write the code for these two classesand make them work (cooperate with main function); (4 points)4. Modify main function, to have enemies with all three professions (could berandomly chosen). (3 points)Part 3:5. The factors are imperfect, make the fight too hard or too easy. Changewhatever you want, but leave hints for reviewers to know what you have done.(2 points)如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导