4QQMN506 Programming for Accounting and Finance Assignment

Assignment Help Python Programming
Reference no: EM133146671

4QQMN506 Programming for Accounting and Finance - Kings Business School

Part A (Theory)

Question 1:

a) Explain the difference between a function and a method.

b) Explain inheritance, polymorphism and data encapsulation. Does Python syntax enforce data encapsulation?

c) How is the lifetime of an object determined? What happens to an object when it dies?

d) Explain what happens when a program receives a non-numeric string when a number is expected as input, and explain how the try-except statement can be of use in this situation. Why would you use a try-except statement in a program?

e) Explain what happens when the following recursive function is called with the values "hello" and 0 as arguments:

Question 2:

The two fundamentals of computer science are Algorithms and Information Processing.

a) Briefly describe what is meant by these two concepts?

b) What are the four defining features of an algorithm?

Question 3:

a) Elaborate and explain try-except statements. Why would you use this in a program?

b) Elaborate and explain Multi-Way if statements. Use flowcharts and examples.

Question 4:

Tom is a junior quantitative analyst at a large London based hedge fund. He has been assigned a task to develop a program to continually process and store incoming real time stock price data (for many stocks based in Europe and USA exchanges) from a platform and store this into a database as efficiently as possible.

Discuss the costs and benefits for different programming approaches and object orientated programming (OOP) Tom could utilise in designing this complex program.

Part B (Practical Coding)

Question 5:

The German mathematician Gottfried Leibniz developed the following method to approximate the value of π:

π/4 = 1 - 1/3 + 1/5 - 1/7 + . . .

Write a program that allows the user to specify the number of iterations used in this approximation and that displays the resulting value.

An example of the program input and output is shown below:

Question 6:

A list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor.

Define a function isSorted that expects a list as an argument and returns True if the list is sorted, or returns False otherwise.

(Hint: For a list of length 2 or greater, loop through the list and compare pairs of items, from left to right, and return False if the first item in a pair is greater.)

Below is an example of the main function:

Below is an example of the associated output:

Question 7:

In the game of Lucky Sevens, the player rolls a pair of dice. If the dots add up to 7, the player wins $4; otherwise, the player loses $1.

Suppose that, to entice the gullible, a casino tells players that there are lots of ways to win: (1, 6), (2, 5), and so on.

A little mathematical analysis reveals that there are not enough ways to win to make the game worthwhile; however, because many people's eyes glaze over at the first mention of mathematics, your challenge is to write a program that demonstrates the futility of playing the game.

Your program should take as input the amount of money that the player wants to put into the pot, and using a random number generator play the game until the pot is empty.

At that point, the program should print:

1. The number of rolls it took to break the player

2. The maximum amount of money in the pot.

Attachment:- Programming for Accounting and Finance.rar

Reference no: EM133146671

Questions Cloud

Evaluate the role of organizational structure changes : Admit it. Sometimes the projects you're working on (school, work or both) can get pretty boring and monotonous. Wouldn't it be great to have a magic button you
Scenario analyses of the new international target : Conduct an assessment of why, where, and how this company might expand internationally. Talk through the pros and cons of what you've recommended.
Identify one business risk : Identify one business risk that is relevant to the casino entertainment industry (other than covid-19).
Journalize the entries for the february purchase : The fair value of the securities on December 31, 20Y7, is $350,000. Journalize the entries for the February 24 purchase
4QQMN506 Programming for Accounting and Finance Assignment : 4QQMN506 Programming for Accounting and Finance Assignment Help and Solution, Kings Business School - Assessment Writing Service
Disclosure requirements for correction of errors : What are accounting errors and how they are reported. What are the disclosure requirements for correction of errors.
Concerned about dramatic rise in inventory : Describe why you are or are not concerned about the dramatic rise in inventory. How is the company performing financially compared to the industry standards?
Prepare the sales budget : Based on a sales price of P150 per unit: a. Prepare the Sales Budget (For the year 2022). b. Prepare the Production Budget (For the year 2022)
Disposable diapers and emerging economies : Using the Internet or your library, conduct a search on the topics of "infant formula" or "disposable diapers" and "emerging economies." What are some of the et

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd