Implement a C++ program in an objected-oriented programming style and use comments to explain the syntax and structure of C++.
(a) Declare the Rectangle class as follows:
(i) Two private variables: Length, Width.
(ii) Constructor with input of Length and Width.
(iii) One function to get perimeter.
(iv) Another function to get aspect-ratio (ratio of Length to Width).
(v) Another function to get area.
(b) Write a main() function to demonstrate how the constructors in part (a) are being used.
(i) To get user inputs of Length and Width
(ii) Create objects based on user inputs.
(iii) Display the perimeter, aspect-ratio, and area of the circle.
(c) Using SDL or SFML to visualize the rectangle.
Native Singapore Writers Team
100% Plagiarism-Free Essay
Highest Satisfaction Rate
Free Revision
On-Time Delivery
Your company is organizing an exhibition match of the game “League of Legends” as team- bonding activity for this month. You are asked to apply C++ to program and implement a player grouping system.
Requirements of the grouping system:
– 10 participants are to be divided into two teams of 5 members each.
– Each participant will be registered with name and performance rating between 1 and 10 points (inclusive).
– To make the exhibition match as exciting as possible, we need to divide the 10 participants into two teams as evenly as possible in terms of skill level. For example, given the gaming performance ratings of the 10 participants as follows: 5, 1, 8, 3, 4, 6, 7, 10, 9, 2, the optimal division would be (1, 3, 5, 8, 10) and (2, 4, 6, 7, 9), resulting in the smallest difference in
strength between the two teams, which is 1.
Remember to add comments to explain the syntax and structure of C++ language. Write down codes with comments to implement the following functions:
(a) Receive each participant name and performance rating of each participant.
(b) Your algorithm starts grouping after all 10 participants information received and ultimately displayed the grouping result as shown in the figure below.
(c) Calculate and display the absolute difference value between the two groups.
Apply C++ language to program a puzzle game. The puzzle involves arranging a set of twenty- five numbers in an ascending order. The numbers are displayed in a 5×5 grid. These numbers are randomly generated and yet to be sorted. The player is required to sort these numbers by swapping two adjacent numbers each time and ultimately sort the set of numbers in an ascending order. A number can be swapped with another number on its right, left, top or bottom. Take note that a number cannot be swapped with a number that is diagonally adjacent to it.
Figure Q3(i) shows a sample initial screen of the game with the 25 randomly generated numbers arranged in a 5×5 grid.
For example, if the number 7537 is to be moved, then it can be swapped with either the number 2053 (top), 8999 (bottom), 8154 (left), or 4982 (right). Any illegal swapping will result in an error message being displayed as shown by Figure Q3(ii). Figure Q3(iii) shows the result of player swapping the numbers 7537 and 2053 in a partially sorted manner.
You are required to implement the puzzle game with the following specifications:
(a) The program should randomly generate 25 numbers. Different set of numbers should be displayed each time the program is started. The program displays the 25 numbers in a 5×5 grid. Each number should be enclosed in an ASCII box, as shown in Figure Q3(i). (
(b) The program should prompt the player to swap two adjacent numbers as shown in Figure Q3(ii). It should check for illegal moves if the two numbers are not adjacent to each other either horizontally or vertically. It should display an error message if the move is not allowed as shown in Figure Q3(ii).
(c) If the move is legal, the program should perform the swap and display it on the screen. If the numbers are still not sorted, the program should prompt for the next move, as shown in Figure Q3(iii).
(d) If the numbers are sorted, the program should display the result and a message informing the user that he has successfully completed the puzzle, as shown in Figure Q3(iv).
(e) Instead of putting all your codes in the main() function, you should decompose your program into meaningful functions. For example, you should have a function for each of the following tasks:
Displaying the puzzle.
Getting input from the user.
Check if user has selected two locations that are adjacent.
Check if the numbers are sorted.
(a) Apply C++ and SDL to implement an animation of running stickman with a click button to start/stop in SDL window:
(i) Create a window with resolution of 800*600.
(ii) Use the sprite sheet provided below to display the animation of a running stickman.
The post MTD215 TMA01 (Tutor-Marked Assignment 01) SUSS: July 2024 – Application of C++ in Multimedia appeared first on Singapore Assignment Help.
Why Work with Us
Top Quality and Well-Researched Papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Free Unlimited Revisions
If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.
Prompt Delivery and 100% Money-Back-Guarantee
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & Confidential
We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admissions
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Reviews
Editing Support
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
Reviews
Revision Support
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.