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

  Add three rows to the downloads

Add three rows to the Downloads table: one row for user 1 and product 2; one for user 2 and product 1; and one for user 2 and product 2. Use the GETDATE function to insert the current date and time into the DownloadDate column.

  Write statement which creates table named part

Write the statement which creates table named Part, with Id field as an int idendity PK, a SupplierId int field, a Description string field of size 25, a Count int field, a Class string field

  Select statement to return one row

Write a SELECT statement that returns one row for each general ledger account number which contains three columns.

  Pretend that you are on the boards

Pretend that you are on the boards of the American National Standards Institute (ANSI) and the International Organization for Standards (ISO), two of the organizations who standardized SQL

  F does not logically imply

Given R = (J,K,L ) and the set F of FDs J -> K and L -> K , show that F does NOT logically

  Decomposition for r = (a,b,c,d,e )

Give a good decomposition for R = (A,B,C,D,E ) with the following functional dependencies:

  Update stock levels when the order is cancelled

Execute queries to confirm that the basket order status and product stock levels have been appropriately modified by the trigger - the trigger needs to fire when a new status record is added to the BB_BASKETSTATUS table and when the IDSTAGE col..

  Design new transaction by sql statements

Code SQL statements to update view as follows: change spelling of Mark Tobey to Mark Toby. Design new Transaction for Mark Toby. Suppose you have essential transaction, work, and customer data.

  Write sql create table statement to create pet table

Write an SQL CREATE TABLE statement to create the PET table without referential integrity constraint on OwnerID in PET.

  Pl-sql block to display last name and salary

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

  Write a program in towers of hanoi

How to write a program in towers of hanoi using pl/sql language

  Write sql statement to create view

Write a SQL Statement to create a View called vwEmployeeTerritories that will do the following: Return all Employees and their Territories (use INNER JOIN).

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