Performing the mathematical operation

Assignment Help Business Management
Reference no: EM131267212

In Python

Part 1 : 40 pts Create a function that will take a file name as an argument. This function should open the file associated with that file name and read each line of that file. Each line should be appended to a list and the function should return that list. The list returned should have an element for each line of the file and that element should be the string that is at that line in the file.

Part 2 : 40 pts Create a function that will accept a list of strings. Each string in this list will contain a series of mathematical operations with numbers and operators separated by spaces. For example, "1 + 4 - 3". For each element of the list your code should split the string into each of it's parts and complete the mathematical operation for that string. It should then write the result of that operation to an output file. Each line of the output file should contain the result of performing the mathematical operation for the corresponding element of the list that was passed to this function. You may use the split() function to split each string into it's separate parts.

Part 3 : 20 pts Create a main function that will ask the user to input a file name. Pass that file name to the first function of this assignment. Pass the value that is returned from the first function into the second function. Don't forget to call main at the end of your program

Notes: You should turn in only one file. The input file that I will use to test your program will contain a string that follows the format described in part two on each line of that file. You will not have to check that the input is valid.

Reference no: EM131267212

Questions Cloud

Why big data has become a hot topic in the business world : Read the article Big Data basic concepts and benefits explained. Focus on why this has become a hot topic in the business world. Describe why big data has become a hot topic in the business world.
Providing a stable and social environment for the employees : To Increase customer satisfaction by providing training center for our employees to develop their skills and abilities hence, their communication and interpersonal skills will improve the customer satisfaction.
Political unrest in russia : "Regarding recent revolutions in the Arab world and the political unrest in Russia, what role has social media played? How can governments benefit from its citizens use of social media during times of civil unrest?"
Explain how are two types of operating systems similar : What are the differences between a Windows operating system and a Linux operating system? What inherent security controls are included with each operating system? How are the two types of operating systems similar?
Performing the mathematical operation : Each line of the output file should contain the result of performing the mathematical operation for the corresponding element of the list that was passed to this function. You may use the split() function to split each string into it's separate pa..
How the ama code of ethics relates to the issue : What should Jane do? Why?  -  What does the AMA Code of Ethics say about accuracy in promotional materials?
How new technology is provided for foreign countries : Explain how the WHO, GHDx, and the World Health Summit are involved in world health, including information about how new technology is provided for foreign countries.
What is the minimum amount that you will accept today : What component of CEO pay do you think most aligns the interests of stockholders and CEOs? Explain. What is the minimum amount that you will accept today if you are to select the lump sum offer
Design a promotional message or theme : Define your promotional objectives. What specific results do you hope to accomplish, and which promotional tools will be responsible?

Reviews

Write a Review

Business Management Questions & Answers

  Describe the roles of the government and the fed reserve

Describe the roles of the government and the Fed Reserve individually in closing a recessionary gap

  Assignment on interpreting a platonic dialogue

This discussion assignment is designed to help you understand how to read and interpret a philosophical text. Read the assigned readings from the textbook and the online lectures on Socrates and Plato as background before completing the assignment..

  Benefits of the family medical leave act

What are the benefits of the Family Medical Leave Act (FMLA) of 1993? How do these benefits relate to other types of employment leaves? Might the provisions of the act be abused? Explain why or why not. How might employers prevent abuses? Plea..

  Identifying developing treatment protocols

identifying and developing treatment protocols which will continue impacting more and more of the world's population. Provide specific examples to support your response.

  What is the forecast for july

What is the forecast for July? -  If the center received 45 million checks in July, what would be the forecast for August?

  Every additional worker employed output

Assuming that the output per worker is R122 000 and for every additional worker employed output will increase with R122 000 (in other words, constant returns apply). By how much will employment increase if the economy grows at 3.5%?

  How would you have improved the process if you had it to do

What went well during this process? What could have been better? In reflection, how would you have improved the process if you had it to do over again?

  Descriptions of the cost accounting system

Identifying the specific cost accounting system an organization utilizes and how it uses the accounting information for financial management. Your paper must include the following:

  Counterproductive work behavior

Counterproductive Work Behavior

  Evaluate how organizational functions

Evaluate how organizational functions (such as marketing, finance, human resources, and operations) influence and determine the organizational structure of the organization you selected.

  Promote organizational effectiveness

CS Bennett company needs update the company mission statement and identify ten values which promote organizational effectiveness. What would these ten values be and why did you choose them?

  Discuss in detail 4 types of reward systems

What goals would you set for the sales staff, given your answer to number 1?

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