Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. [Marks: 50%] Write a program that puts the contents of a text file called employees.txt, containing space?separated employees id, salary, and increase percentage, into

1. [Marks: 50%] Write a program that puts the contents of a text file called employees.txt, containing space?separated employees id, salary, and increase percentage, into a dictionary. The program then displays the items of the dictionary in order of increases, from the employee that will receive the smallest increase to the one that will receive the highest increase. For example, consider the following contents of file employes.txt:

100123456 42659.03 3.7

100246800 25498.29 4.5

100654321 46321.11 2.4

The increase is computed by multiplying the salary by the increase percentage. For example, the increases for the example above would be:

100123456 42659.03 3.7 1578.38

100246800 25498.29 4.5 1147.42

100654321 46321.11 2.4 1111.71

And therefore, your program should display the following list of employees sorted by salary increase:

100654321 46321.11 2.4 1111.71

100246800 25498.29 4.5 1147.42

100123456 42659.03 3.7 1578.38

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

Explain Coulomb's law with an example

Answered: 1 week ago

Question

What is operating system?

Answered: 1 week ago

Question

What is Ohm's law and also tell about Snell's law?

Answered: 1 week ago