Write a Python program to compute the largest absolute change that occurred in the price of a stock during a 10 -day per

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a Python program to compute the largest absolute change that occurred in the price of a stock during a 10 -day per

Post by answerhappygod »

Write A Python Program To Compute The Largest Absolute Change That Occurred In The Price Of A Stock During A 10 Day Per 1
Write A Python Program To Compute The Largest Absolute Change That Occurred In The Price Of A Stock During A 10 Day Per 1 (34.22 KiB) Viewed 55 times
Write A Python Program To Compute The Largest Absolute Change That Occurred In The Price Of A Stock During A 10 Day Per 2
Write A Python Program To Compute The Largest Absolute Change That Occurred In The Price Of A Stock During A 10 Day Per 2 (46.24 KiB) Viewed 55 times
Write a Python program to compute the largest absolute change that occurred in the price of a stock during a 10 -day period. The program should prompt the user 10 times for integers representing the stock price on ten consecutive days. If the integers input were then the program should print a message like Largest change of 25 from 84 to 59 occurred between day #6 and day #7. Your program must implement and use the following two functions def print_change(day1 price, day2 price, day1_num):
The function print _ change should take the prices on the two days and the number of the initial day of the change and print out the message. The function find_change should take no parameters, prompt the user for the stock prices and return a list with the prices on the two days, and the number of the initial day of the change. Other thank the user prompts, find_change should not print anything out. Your main function should use the functions find_change and print_change to execute the program. You must design your program in such a way that you do not have to save all the prices in memory before computing the answer. As well, modifying the total number of days from 10 to 30 (for example) should merely require updating one variable. You are not allowed to use any list, tuple, string variables in this problem other than the return value of find_change, which is a list. You are also not allowed to use 10 variables to store the prices. You will get no credit for such a solution.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply