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

  Draw an entity-relationship diagram

Draw an Entity-Relationship Diagram (ERD) for the data storage requirements of a business described in the case study and Data Model Transformation.

  Write sql statement which creates stored procedure

Write SQL statement which creates stored procedure with one int input parameter. Stored procedure selects supplierId field and total of all Count field values for each group of supplierId's from Part table.

  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

  Provide a comprehensive record of using sql

Learning Objectives: The purpose of Project 3 is to enable the students to gain extensive experience with using SQL to design and query databases.

  Create a comparison document

Create a Comparison Document

  Can we offer an example of a query

Can we offer an example of a Query in which we can use a parentheses to affect the order of execution in which the WHERE Clause has both AND and OR Logical Operators?

  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

  Describe the meaning of keyword exists and not exists

Describe the meaning of the keyword EXISTS. Describe how any and all relate to EXISTS and NOT EXISTS. Write a query which will display names of any customers who are interested in all artists.

  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.

  Create a view named customer addresses

Create a view named CustomerAddresses that shows the shipping and billing

  If the value for the listprice column is a negative number

If the value for the ListPrice column is a negative number, the stored procedure should raise an error that indicates that this column doesn't accept negative numbers. Similarly, the procedure should raise an error if the value for the DiscountPer..

  Write a compete pl/sql program to display the staffno

Write a compete PL/SQL program to display the StaffNo,

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