Demonstrating Advantages of Dynamic Typing - IT Assignment Help

Download Solution Order New Solution
Assignment Task:

Task:

Task 2: Demonstrating Advantages of Dynamic Typing
There are commonly-claimed advantages of Dynamic Typing:
1. More generic code can be written. In other words, functions can be defined to apply on arguments of di↵erent types.

2. Possibilities of mixed type collection data structures.
Please provide a scenario and concise example codes to demonstrate the advantages of Dynamic Typing mentioned above. You are welcome to provide other advantages and disadvantages along with code segment for extra bonus points.
Dynamic Typing makes coding more flexible and convenient, but you should bear in mind that type checking can only be carried out at runtime, incurring time overhead and reliability issues.

4 Task 3: Aircraft War
This task is to implement a cool aircraft game in Python. A Java version of the game is provided to you. You are required to comprehend the Java implementation and re-implement this game with Python. After accomplishing this task, you will have experienced a special feature of Python called Duck Typing that is available only in dynamically typed programming languages. Don’t worry about the graphics user interface! We will provide it to you.

4.1 Duck Typing
The following synopsis of Duck Typing is summarized from:
http://en.wikipedia.org/wiki/Ducktyping
http://www.sitepoint.com/making-ruby-quack-why-we-love-duck-typing
In standard statically-typed object-oriented languages, objects’ classes (which determine an object characteristics and behavior) are essentially interpreted as the objects’ types. Duck Typing is a new typing paradigm in dynamically-typed (late binding) languages that allows us to dissociate typing from objects’ characteristics. It can be summarized by the following motto by the late poet James Whitcombe Riley:
When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck.

The basic premise of Duck Typing is simple. If an entity looks, walks, and quacks like a duck, for all intents and purposes it is fair to assume that one is dealing with a member of the species anas platyrhynchos. In practical Python terms, this means that it is possible to try calling any method on any object, regardless of its class. An important advantage of Duck Typing is that we can enjoy polymorphism without inheritance. An immediate consequence is that we can write more generic codes which are cleaner and more precise.
4.2 Background
One day in 3021 A.D., a powerful alien civilization invades the earth. The enemies have di↵erent kinds of fighter planes and a powerful boss ship. You, a brave and well-trained air force pilot, have received an urgent task to protect your homeland. Drive your fighter plane and take down your enemies. Try to avoid enemy bullets, especially the scaring destructive bombs that will destroy you immediately once you are hit. On the way you fight, there will be supplies to assist you. Pick them up as much as possible. Go ahead, my hero!
 

4.3 Environment Preparation

Before you can build and run the Java program we provide, you may have to prepare your de- velopment environment first. We will provide a virtual machine containing everything you need in development. If you prefer programming on your own machine, please follow the instructions below to install the development kits and some necessary packages. If you cannot be bothered to configure all these things, please use our virtual machine instead.

1. Build Tools. We provide a Makefile so that you can easily build the Java application via a make command. On any Ubuntu machine with root privilege, install build tools by executing the following command in the terminal sudo apt-get install build-essential On MacOS, if make command is not found, you should install the build tools via XCode. On Windows, you should consider downloading an IDE and configure it by yourself.

2. Java Development Kit (JDK). In order to build the Java source files, you have to install JDK first. There are di↵erent JDKs available for a variety of platforms. To build this Java application, feel free to install any kind of JDK, like OpenJDK, Oracle JDK, IBM Java SDK, Apache Harmony, etc. Please refer to their o cial websites for installation guide in detail. We recommend you to install the open-source OpenJDK. On any Ubuntu machine with
root privilege, open your terminal and execute the following command to find all available OpenJDK versions. apt search ^openjdk-[0-9]*-jdk$
Install any version you like via the following commands. Replace <version> with specific version number. For example, you can install any one of openjdk-8-jdk, openjdk-11-jdk, openjdk-13-jdk and openjdk-14-jdk on Ubuntu 20.04 LTS. sudo apt-get update

# Replace <version> with a specific version number.
# For example, install openjdk-14-jdk on Ubuntu 20.04 LTS.
sudo apt-get install openjdk-<version>-jdk
After executing this command in the terminal, you should have already installed OpenJDK correctly. Check the Java version and Java compiler version by java --version and javac --version. You will get a similar output as follows if everything goes fine:
$ java --version
openjdk version "14.0.2" 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 14.0.2+12-Ubuntu-120.04, mixed mode, sharing)
$ javac --version
javac 14.0.2

 

This IT Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.