Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write your own function that illustrates a feature that you learned in this unit. The function must take at least one argument. The function should be your own creation


Write a program that will perform the following:


A. Display Employee List

(Retrieve records from empList.txt, store it in a dictionary, display the employee list arranged by keys)


Note: Refer to example code in dictionary module (bbl) for sorting


B. Add Employee

(

Ask user to input the following data:

- unique employee number

- lastname

- firstname

- department

- rate per day

Write the employee record to the empList.txt

)


C. Add Payroll Record

(Ask user to input the following data:

-employee number

-month

-no of days worked

write the payroll record into the empMR.txt

)


D. Generate pay slip


Ask for employee number and month of the payslip to be generated

Create a payslip like statement written in a text file.


=============================================================

Payslip for the Month of _________________

Employee No.: ______________       Employee Name: _____________

Department: ________________

Rate per Day:_______________       No. of Days Worked: ________

Gross Pay: _________________




The volume of a sphere is 4/3πr3, where π has the value of "pi" given in Section 2.1 of your textbook. Write a function called print_volume (r) that takes an argument for the radius of the sphere, and prints the volume of the sphere.

Call your print_volume function three times with different values for radius.

Include all of the following in your Learning Journal:

  • The code for your print_volume function.

The inputs and outputs to three calls of your print_volume.




matrix rotation


You are given two strings of same length and comprosied of + and - , print a new string that shows the result of the interaction of the two strings assume the following rules.



Interaction between two positive characters results in a positive character.



( "+" Against a "+" returns another "+")



Interaction between two negative characters results in a negative character.



("-" Against a "-" returns another "-")



Interaction between a positive and a negative character results in a " 0" (Neutral)



("+" against a "-" returns a "0")




Input: ++++++ ------



Output: 000000



Input: +-----+++- --+-+-++--



Output: 0-0-0-++0-





Assignment


Using the IDLE development environment, create a Python script named tryme4.py. (Note: an alternative to IDLE is to use a free account on the pythonanywhere website: https://www.pythonanywhere.com/)



Write a function in this file called nine_lines that uses the function three_lines (provided below) to print a total of nine lines.


Now add a function named clear_screen that uses a combination of the functions nine_lines, three_lines, and new_line (provided below) to print a total of twenty-five lines. The last line of your program should call first nine_lines and then the clear_screen function.


The function three_lines and new_line are defined below so that you can see nested function calls. Also, to make counting “blank” lines visually easier, the print command inside new_line will print a dot at the beginning of the line:


def new_line():


print('.')


def three_lines():


new_line()


new_line()


new_line()





Given two strings N and K. Your goal is to determine the smallest substring of N that contains all the characters in K. If no substring is present in N print no matches found.



Note: If character is repeated multiple times in K, your substring should also contain that character repeated same number of times.



Input: first line contains two strings N and K



Output: string representing the smallest substring as mentioned above




Input1: stealen lent



Output 1: tealen



Input 2: tomato tomatho



Output 2: No matches found





Write a program to find the sum of odd numbers in first N natural numbers.


Write a function solution that given a three digit integer N and Integer K, returns the maximum possible three digit value that can be obtained by performing at most K increases by 1 of any digit in N



Submit your Python script file in the posting of your assignment. Your Python script should be either a .txt file or a .py file.




You must execute your script and paste the output produced into a document that you will submit along with your Python script.




It is very helpful if you print a placeholder between the printing of 9 lines and the printing of 25 lines. It will make your output easier to read for your peer assessors. A placeholder can be output such as “Printing nine lines” or “Calling clearScreen()”.




The following items will be used in the grading rubric for this assignment. Make sure that you have addressed each item in your assignment.





Does the assignment implement new_line, three_lines, nine_lines, and clear_screen functions, as well as a main section of the program which calls the functions?





LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS