Question: Python programming A programmer writes a program to calculate a stock indexand incorrectly truncates the indexafter 2 decimal places , rather than usingcorrect rounding. In

Python programming

A programmer writes a program to calculate a stock indexand incorrectly truncates the indexafter 2 decimal places, rather than usingcorrect rounding. In other words a stock valueof 1000.54321 is replaced by 1000.54.

The program is applied in an automated trading program whichrecalculates the stock index everyminute during the normal tradinghours (10am to 4pm) forthe 250 trading days in a year.

Write a Python program to estimate the error in the resultingestimate of the index.

The output from your program should look like this:

Instructions Problem A programmer writes a program to calculate a stock index

Instructions Problem A programmer writes a program to calculate a stock index and incorrectly truncates the index after 2 decimal places, rather than using correct rounding. In other words a stock value of 1000.54321 is replaced by 1000.54. The program is applied in an automated trading program which recalculates the stock index every minute during the normal trading hours (10am to 4pm) for the 250 trading days in a year. Write a Python program to estimate the error in the resulting estimate of the index. The output from your program should look like this: Stock Exchange Index Error: ANSWER where ANSWER is the correct answer to the calculation. Prob f X y Z d S Instructions Problem A programmer writes a program to calculate a stock index and incorrectly truncates the index after 2 decimal places, rather than using correct rounding. In other words a stock value of 1000.54321 is replaced by 1000.54. The program is applied in an automated trading program which recalculates the stock index every minute during the normal trading hours (10am to 4pm) for the 250 trading days in a year. Write a Python program to estimate the error in the resulting estimate of the index. The output from your program should look like this: Stock Exchange Index Error: ANSWER where ANSWER is the correct answer to the calculation. Prob f X y Z d S

Step by Step Solution

3.57 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solution Here we will use round function in Python to estimate th... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!