Write a iterative function that returns the summation

Assignment Help PL-SQL Programming
Reference no: EM13310690

Description of the assessment:
This assignment has three tasks.

(1) Write an Employee class with the following attributes and methods:

Attributes (variables):
id, name, department, salary, years of service
Methods:
addEmpDetails(): to add items in the employee list
delEmpDetails(): to delete employee from the list
getEmpDetails(): to access the employee details
saveEmpDetails_File(): to save the employee information in a .txt file
emp_service_years(): to print the IDs and names of employees who worked for 10 years and more.
change_dept(): change the employee's department information if they change the department.
The details of the employees are in the following Table 1. In the main function:

(a) Add employee information given in Table 1 using addEmpDetails() method.
(b) Test the getEmpDetails() method by printing the employee details.
(c) Test the emp_service_years method by printing the names and IDs of the employees who worked for 10 years and more.
(d) Call the respective method that saves the employee information in a file and check if it has correctly saved all the information in the file.
(e) Test the change_dept() method to change any employee's department (print employee details to confirm this function works).
(f) Test the delEmpDetails() method, delete any employee's details and print it on the screen to verify if this function works or not.
(g) Write code that display the details of the employee on the screen using the GraphWin object (You can refer to the files provided (display.py and list.txt) as sample)

Table 1: Employee information

2343_Description of the assessment.png

(2) Write and test functions that return summation of all the numbers (items) in the list. For this task do the following:

a. Ask the user to enter a list of numbers and you build up a list with those numbers
b. Write a recursive function that returns thesummation of all the numbers in the list
c. Write a iterative function that returns the summation of all the number in the list
d. You need to provide a piece of code to show how you tested the functions

e. Verify the results from the recursive and iterative functions (from steps b and c).


(3) Modify the code for question 2 to include exception handling mechanism to catch potential errors. Your code should:

a. Catch at least two types of errors
b. It should display a message for the user showing the type of error and possible solution to correct this error.

Reference no: EM13310690

Questions Cloud

Calculate the percentage of change in total volume : Calculate the percentage of change in total volume with respect to its initial volume when a specimen of this clay is completely dried from a water content of 80%. Assume that the clay remains saturated from liquid limit to shrinkage limit.
Read the hoosier burger scenario : Read the Hoosier Burger scenario
Briefly explain reason for variation of water coefficient : A homogeneous coarse sand deposit has a water table at 10 m depth. The water coefficient of permeability of the sand is found to vary significantly with height above the water table even though the sand deposit is homogeneous.
Briefly explain the problem encountered in the measurement : A tensiometer is used to measure a compacted soil in the field that has a matric suction of 200 kPa under atmospheric conditions. The pore-water pressure measurement in the tensiometer reaches -99 kPa
Write a iterative function that returns the summation : Write and test functions that return summation of all the numbers (items) in the list. Write a recursive function that returns the summation of all the numbers in the list.
How far above the hanging location does the target swing : A clay ball (m=0.82 kg) is thrown at a metal target (M=1.72 kg) that is suspended from a cable. The ball is released 1.5 m above teh ground at an angle of 32 degrees.
What kind of glasses would you prescribe : An alien race has evolved such that their eyes work exactly like ours except their eyes can be modeled with a biconcave lens. WHen they come to visit us, what kind of glasses would you prescribe
The theory of comparative advantage : 1.Does intra-firm trade contradict the theory of comparative advantage? Why or why not?
Determine the safe load the column can carry using method : A column of dimensions 200 X 300 mm has an effective length of 3m. It is reinforced with 6 HYSD bars of 20mm diameter. Determine the safe load the column can carry using working method of design. Using M20 Concrete.

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

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