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

  Display the customerid from the orders table

Display the CustomerID from the Orders table and the sum of the associated ItemPrice multiplied by Quantity using Gross Sales (with a space) as the column name from the OrderItems table.

  Indicate the changes

Indicate the changes (using the shorthand representation) that you would need to make to the original Premiere Products database design to support the following requirements. There is no relationship between customers and sales reps.  When a custo..

  Create a database model

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

  Create report to display scr courses in alphabetical order

Create the detail report which will display all SCR courses in alphabetical order, with a course name and instructor name in the group header.

  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.

  Produce a diagram showing schema

Produce a diagram showing schema and the partial and transitive dependencies in your 1NF. b. Produce a diagram showing table schema and any transitive dependencies in your 2NF

  Write a pl/sql block and declare a variable v_sal

Write a PL/SQL block and declare a variable  v_sal  of the type NUMBER. Include the following statement in the Execution section:

  Script below to create an updateable

Use the script below to create an updateable view named balance_due_view. Then, create and test an INSTEAD OF trigger named invoices_instead_of_insert that lets the user update the columns in the view by directly updating the Invoices table.

  Produce a report showing an organization chart

Produce a report showing an organization chart for Mourgos's department. Print last names, salaries, and department IDs and create a report that shows the hierarchy of the managers for the employee Lorentz. Display his immediate manager first

  Sql statement which select names and owners of great danes

Write SQL statement which would select each of the following: names and owners of all Great Danes and all attributes of poodles whose balance is no greater than $50.

  Write select statement to return those rows with due balance

Write SELECT statement which returns those rows with the balance due greater than 1000. Sort result set by InvoiceTotal, with largest invoice first.

  Write pl-sql block which displays last name

Write PL/SQL block which displays last name and salary of following people. Each of these can be done separately as PL/SQL, first to test and get output lines

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