TM112-TMA-Spring21-22 عبدالعزيز

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Faculty of Computer

StudiesTM112
Introduction to Computing and InformationTechnology2
Spring2021/2022

Tutor-
MarkedAssignment
NameofStudent. :Abdulaziz Fahad madani
Signature:…………………………………………...

Date:……………………………………………………

1
.. Question1:(20marks)

..... answer Q1

1
Containers are best known for their ability to be run in a cloud, but they are also
portable across physical servers and virtual machines and can be used with or without
an operating system. Modern containers can be thought of as lightweight VMs that don't
require a lot of overhead to set up and maintain. They're not just limited to Linux
applications, either; you can use them on Windows Server too (Bernstein, 2014).
Containers are great because they reduce complexity by allowing applications to share
resources while remaining isolated from other processes running on the same machine.
2.
The purpose of containers is to make it easier for organizations to deploy applications
and services, in addition to helping them meet cloud-native application development
best practices, like rapid deployment and ease of scaling. Containers are used to
package applications into units that have everything needed to run them: code, runtime,
system tools and libraries(Bernstein, 2014). This helps developers move applications
from development environments into production more quickly and easily than ever
before. Cloud containers also allow organizations to deploy containerized applications
using a variety of platforms and infrastructure providers.
3.
A container is a package that contains everything necessary to run an application or
service, including code, runtime, system tools and libraries, packages and configuration
files. VMFs A virtual machine file (VMF) is a type of disk image used by VMWare
products. One of the main differences between containers and VMFs is the latter can be
created from scratch using a tool called VMware Workstation Player, or it can be created
from another VMF using VMware Converter. Containers on the other hand are typically
created with Docker (Rosen, 2014). This means you can't just take a pre-existing VMF
and use it as a container, but you could take an existing Dockerfile and use it to create a
new container.
4.
Docker is a container platform that allows people to build, ship and run distributed
applications anywhere, on a wide range of infrastructure. It provides an additional layer
of abstraction and automation for operating system-level virtualization on Linux (De
Benedictis & Lioy, 2019). Docker uses resource isolation features of the Linux kernel
such as cgroups and kernel namespaces to allow independent containers to run within
a single Linux instance, avoiding the overhead of starting and maintaining virtual
machines.
5.
Application containerization is a technique for deploying applications as self-contained
software packages that include everything necessary to run on their own without relying
on an external environment or configuration. Containers allow developers to package
up all of an application's dependencies and ship them with it, so they can be deployed
anywhere with ease.
6.
Application containerization makes it easy for developers to package and deploy
applications with their dependencies, so they can be run on almost any infrastructure
that supports Docker, regardless of operating system. The second benefit is in security
2
and compliance with enterprise policies. Because containers are self-contained
packages, they make it easier to track what's happening inside an application and
ensure that sensitive data isn't being accessed or stored where it shouldn't be(Rosen,
2014). In addition, because all of an application's dependencies are packaged together,
you don't have to worry about keeping multiple versions of each dependency up to date.

References
Bernstein, D. (2014). Containers and cloud: From lxc to docker to kubernetes. IEEE
Cloud Computing, 1(3), 81-84.
De Benedictis, M., & Lioy, A. (2019). Integrity verification of Docker containers for a
lightweight cloud environment. Future generation computer systems, 97, 236-246.
Rosen, R. (2014). Linux containers and the future cloud. Linux J, 240(4), 86-95.

Question2:(20marks)
a.

# Prompt user to enter the number of records to enter


n = int(input("Enter the number of records you want to enter: "))
# open a new/existing file
. f = open("file1.txt", "a")
# setting the least possible value of grade
highestGrade = 0
# setting the name of topscorer as null
topScorer = ""
# looping to get the name and grade
for i in range(0, n):
# prompt to enter the name
name = input("Enter the name: ")
# write the name to file
f.write(name+'\n')
# prompt to enter the grade
grade = int(input("Enter the grade: "))
# write the grade to file
f.write(str(grade)+'\n')
# check if the highestGrade is less than current entered grade
if(grade > highestGrade):
# if greater, save the current grade as highest grade
highestGrade = grade
# save the current name as topscorer
topScorer = name
# writing the highscore details to file
f.write(f"\nHigh Score: {highestGrade}\nHeld By: {topScorer}\n\
nNumber of Scores: {n}")
print(f"\nHigh Score: {highestGrade}\nHeld By: {topScorer}\n\
nNumber of Scores: {n}")

3
4
5

You might also like