1) Let us suppose you are implementing file system. This file system contains folders and files. A folder can contain other folders and files. Provide a very simple implementation using an OOP for this simple file system using a composite design pattern. Folders and Files have just one common attribute: its name.

Create a client object that can via methods:
• print file/folder names
• Add files/folders to a folder
• Remove files from a folder

2) Final project
Instructions:
This project is using purescript programming language.
You must provide presentation about your proof-of-concept.
Provide complete instruction indicating how to execute your code
You must also create a 5min video presenting your demo.

Objectives
This is your final project. This project is a banking application simulation of key account management functionalities such as deposit, withdrawal, and statement printing.
The objective of the project is to showcase how bank software developers can build functionalities for withdrawing, depositing, and printing account statements.

Steps involved:
i. Installing the Purescript compiler (purs) with npm:
npm install -g purescript
ii. Setting up the Development Environment with spago
npm install -g spago
iii. Creating a new project in an empty directory using spago init:
mkdir my-project
cd my-project
spago init
spago build
spago test

a. Constraints
The following are key functions implemented in the program.
void deposit(int) – an impure function that accepts int as the amount to be deposited into the account.
void withdraw(int) – an impure function that accepts an int as the amount that will be withdrawn from the account.
String printStatement() – an impure function that prints and returns the account history based on withdrawals and deposits done on the account.
b. Features

• Deposit money into an account
• Withdraw money from an account
• Print Account Statement
c. Technology you used

The tools and technologies used in this project include:
• Visual studio code
• Purescript compiler
• Spango which is a build system for purescirpt
• Html
• Javascritpt
• Dhal

e. Where this project can be applied

This project can be applied in financial technology and banking industries.

Code Snippets

#Main.purs
module Main where
import Prelude

data Transaction
= Deposit Info
| Withdraw Info

derive instance eqTransaction :: Eq Transaction
instance showTransaction :: Show Transaction where
show (Deposit i) = show i
show (Withdraw i) = show i
type Info =
{ timestamp :: DateTime
, amount :: Int
}
deposit :: forall m. Monad m => m DateTime -> Int -> StateT (Array Transaction) m Unit
deposit nowDateTime amount = do
ts <- lift nowDateTime
let t = Deposit { timestamp: ts, amount: amount }
modify_ \ts -> ts <> [t]
withdraw :: forall m. Monad m => m DateTime -> Int -> StateT (Array Transaction) m Unit
withdraw nowDateTime amount = do
ts <- lift nowDateTime
let t = Withdraw { timestamp: ts, amount: amount }
modify_ \ts -> ts <> [t]
printStatement :: forall m. Monad m => (String -> m Unit) -> StateT (Array Transaction) m Unit
printStatement logger = do
s <- gets toStatement
lift $ logger s
toStatement :: Array Transaction -> String
toStatement =
fst <<< foldl fnc (Tuple “” 0)
where
fnc (Tuple s i) (Deposit d) =
Tuple (s <> “\n” <> joinWith ” ” [ show d.timestamp, show d.amount, show $ i + d.amount]) (i + d.amount)
fnc (Tuple s i) (Withdraw w) =
Tuple (s <> “\n” <> joinWith ” ” [ show w.timestamp, “-” <> show w.amount, show $ i – w.amount]) (i – w.amount)

 

Sample solution

Dante Alighieri played a critical role in the literature world through his poem Divine Comedy that was written in the 14th century. The poem contains Inferno, Purgatorio, and Paradiso. The Inferno is a description of the nine circles of torment that are found on the earth. It depicts the realms of the people that have gone against the spiritual values and who, instead, have chosen bestial appetite, violence, or fraud and malice. The nine circles of hell are limbo, lust, gluttony, greed and wrath. Others are heresy, violence, fraud, and treachery. The purpose of this paper is to examine the Dante’s Inferno in the perspective of its portrayal of God’s image and the justification of hell. 

In this epic poem, God is portrayed as a super being guilty of multiple weaknesses including being egotistic, unjust, and hypocritical. Dante, in this poem, depicts God as being more human than divine by challenging God’s omnipotence. Additionally, the manner in which Dante describes Hell is in full contradiction to the morals of God as written in the Bible. When god arranges Hell to flatter Himself, He commits egotism, a sin that is common among human beings (Cheney, 2016). The weakness is depicted in Limbo and on the Gate of Hell where, for instance, God sends those who do not worship Him to Hell. This implies that failure to worship Him is a sin.

God is also depicted as lacking justice in His actions thus removing the godly image. The injustice is portrayed by the manner in which the sodomites and opportunists are treated. The opportunists are subjected to banner chasing in their lives after death followed by being stung by insects and maggots. They are known to having done neither good nor bad during their lifetimes and, therefore, justice could have demanded that they be granted a neutral punishment having lived a neutral life. The sodomites are also punished unfairly by God when Brunetto Lattini is condemned to hell despite being a good leader (Babor, T. F., McGovern, T., & Robaina, K. (2017). While he commited sodomy, God chooses to ignore all the other good deeds that Brunetto did.

Finally, God is also portrayed as being hypocritical in His actions, a sin that further diminishes His godliness and makes Him more human. A case in point is when God condemns the sin of egotism and goes ahead to commit it repeatedly. Proverbs 29:23 states that “arrogance will bring your downfall, but if you are humble, you will be respected.” When Slattery condemns Dante’s human state as being weak, doubtful, and limited, he is proving God’s hypocrisy because He is also human (Verdicchio, 2015). The actions of God in Hell as portrayed by Dante are inconsistent with the Biblical literature. Both Dante and God are prone to making mistakes, something common among human beings thus making God more human.

To wrap it up, Dante portrays God is more human since He commits the same sins that humans commit: egotism, hypocrisy, and injustice. Hell is justified as being a destination for victims of the mistakes committed by God. The Hell is presented as being a totally different place as compared to what is written about it in the Bible. As a result, reading through the text gives an image of God who is prone to the very mistakes common to humans thus ripping Him off His lofty status of divine and, instead, making Him a mere human. Whether or not Dante did it intentionally is subject to debate but one thing is clear in the poem: the misconstrued notion of God is revealed to future generations.

 

References

Babor, T. F., McGovern, T., & Robaina, K. (2017). Dante’s inferno: Seven deadly sins in scientific publishing and how to avoid them. Addiction Science: A Guide for the Perplexed, 267.

Cheney, L. D. G. (2016). Illustrations for Dante’s Inferno: A Comparative Study of Sandro Botticelli, Giovanni Stradano, and Federico Zuccaro. Cultural and Religious Studies4(8), 487.

Verdicchio, M. (2015). Irony and Desire in Dante’s” Inferno” 27. Italica, 285-297.

This question has been answered.

Get Answer