[SOLVED] DBS211-Assignment 1

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Assignment01-barnge.zip (1128.7 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
5/5 - (4 votes)

In this assignment, you create a simple HR application using the C++ programming language and Oracle server. This assignment helps students learn a basic understanding of application development using C++ programming and an Oracle database.

Instruction:

In this assignment, we use the same database that you use for your labs.

Connecting to an Oracle database from a C++ Program

 

In your function main(), create a connection to your database.

 

You need to implement the following functions:

int menu(void);

 

The menu() function returns an integer value which is the selected option by the user from the menu. This function displays the following menu options:

 

  • Find Employee
  • Employees Report
  • Add Employee
  • Update Employee
  • Remove Employee
  • Exit

 

Before printing the menu, display the following title on the screen

 

********************* HR Menu *********************

 

Prompt the user to enter an option. If the user enters an incorrect option, the user is asked to enter an option again. When the user enters a correct option (0 to 5), the function returns the selected value.

 

If the user selects 0 (Exit), the program terminates.

 

int findEmployee(*conn,Β  int employeeNumber, struct Employee *emp);

 

This function receives a connection object, an integer number as the employee number, and a pointer to a variable of type Employee. The function returns 0 if the employee does not exist. It returns 1 if the employee exits.

To store the employee data from the findEmployee() function, we use a variable of type structure called Employee. The Employee structure has the following members:

 

struct Employee{

int employeeNumber;

char lastName[50];

char firstName[50];

char email[100];Β 

char phone[50];

char extension[10];

char reportsTo[100]; Β 

char jobTitle[50];

char city[50];

Β 

};

The ReportsTo member stores the first name and the last name of the employee who is the manager of the given employee number.

If the employee exists, store the employee data into the members of an Employee variable using the third parameter in the findEmployee() function which references to that variable of type Employee.

 

Note: For this report, you may need to query more than one table (join).

 

 

 

 

Β 

void displayEmployee(*conn, struct Employee emp);

 

If the user selects option 1, this function is called. First, prompt the user to enter a value for the employee number. Then, call function findEmployee() to check if the employee with the given employee number exists. If the returning value of function findEmployee() is 0, display a proper error message.

Sample error message:

 

Employee 1122 does not exist.

 

Otherwise, call the function displayEmployee() to display the employee information.

This function receives a connection pointer and values of a variable of type Employee and displays all members of the emp parameter.

 

Display the employee information as follows:

 

employeeNumber = 1002

lastName = Murphy

firstName = Diane

email = [email protected]

phone = +1 650 219 4782

extension = x5800

reportsTo =

jobTitle = President

city = San Francisco

 

 

void displayAllEmployees(*conn);

If the user selects option 2 (Employees Report), call function displayAllEmployees().

This function receives a connection pointer and displays all employees’ information if exists.

 

 

 

Write a query to select and display the following attributes for all employees.

 

EΒ Β Β Β Β Β Β Β Β  Employee Name Β Β Β Β Β Β Β  Email Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Phone Β Β Β Β Β Β Β Β Β Β Β Β  ExtΒ Β Β Β Β Β Β Β Β Β Β  Manager
————————————————————————————————————————

1002Β Β Β Β Β Β Β Β Β Β  Diane MurphyΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected] Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +1 650 219 4782Β Β Β Β Β Β Β Β Β  x5800

1056Β Β Β Β Β Β Β Β Β Β  Mary PattersonΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +1 650 219 4782Β Β Β Β Β Β Β Β Β  x4611Β Β Β Β Β Β Β Β  Diane Murphy

1076Β Β Β Β Β Β Β Β Β Β  Jeff FirrelliΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +1 650 219 4782Β Β Β Β Β Β Β Β Β  x9273Β Β Β Β Β Β Β Β  Diane Murphy

1143Β Β Β Β Β Β Β Β Β Β  Anthony BowΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +1 650 219 4782Β Β Β Β Β Β Β Β Β  x5428Β Β Β Β Β Β Β Β  Mary Patterson

1165Β Β Β Β Β Β Β Β Β Β  Leslie JenningsΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected] Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +1 650 219 4782Β Β Β Β Β Β Β Β Β  x3291Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Anthony Bow

1166Β Β Β Β Β Β Β Β Β Β  Leslie ThompsonΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +1 650 219 4782Β Β Β Β Β Β Β Β Β  x4065Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Anthony Bow

1188Β Β Β Β Β Β Β Β Β Β  Julie FirrelliΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +1 215 837 0825Β Β Β Β Β Β Β Β Β  x2173Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Anthony Bow

1216Β Β Β Β Β Β Β Β Β Β  Steve PattersonΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +1 215 837 0825Β Β Β Β Β Β Β Β Β  x4334Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Anthony Bow

1286Β Β Β Β Β Β Β Β Β Β  Foon Yue TsengΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +1 212 555 3000Β Β Β Β Β Β Β Β Β  x2248Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Anthony Bow

1323Β Β Β Β Β Β Β Β Β Β  George VanaufΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +1 212 555 3000Β Β Β Β Β Β Β Β Β  x4102Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Anthony Bow

1102Β Β Β Β Β Β Β Β Β Β  Gerard BondurΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +33 14 723 4404Β Β Β Β Β Β Β Β Β  x5408Β Β Β Β Β Β Β Β  Mary Patterson

1337Β Β Β Β Β Β Β Β Β Β  Loui BondurΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +33 14 723 4404Β Β Β Β Β Β Β Β Β  x6493Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Gerard Bondur

1370Β Β Β Β Β Β Β Β Β Β  Gerard HernandezΒ Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +33 14 723 4404Β Β Β Β Β Β Β Β Β  x2028Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Gerard Bondur

1401Β Β Β Β Β Β Β Β Β Β  Pamela CastilloΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +33 14 723 4404Β Β Β Β Β Β Β Β Β  x2759Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Gerard Bondur

1702Β Β Β Β Β Β Β Β Β Β  Martin GerardΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +33 14 723 4404Β Β Β Β Β Β Β Β Β  x2312Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Gerard Bondur

1621Β Β Β Β Β Β Β Β Β Β  Mami NishiΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +81 33 224 5000Β Β Β Β Β Β Β Β Β  x101Β Β Β Β Β Β Β Β Β Β  Mary Patterson

1625Β Β Β Β Β Β Β Β Β Β  Yoshimi KatoΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +81 33 224 5000Β Β Β Β Β Β Β Β Β  x102Β Β Β Β Β Β Β Β Β Β  Mami Nishi

1088Β Β Β Β Β Β Β Β Β Β  William PattersonΒ Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +61 2 9264 2451Β Β Β Β Β Β Β Β Β  x4871Β Β Β Β Β Β Β Β  Mary Patterson

1611Β Β Β Β Β Β Β Β Β Β  Andy FixterΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +61 2 9264 2451Β Β Β Β Β Β Β Β Β  x101Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  William Patterson

1612Β Β Β Β Β Β Β Β Β Β  Peter MarshΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +61 2 9264 2451Β Β Β Β Β Β Β Β Β  x102Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  William Patterson

1619Β Β Β Β Β Β Β Β Β Β  Tom KingΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +61 2 9264 2451Β Β Β Β Β Β Β Β Β  x103Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  William Patterson

1501Β Β Β Β Β Β Β Β Β Β  Larry BottΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +44 20 7877 2041Β Β Β Β Β Β  x2311Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Gerard Bondur

1504Β Β Β Β Β Β Β Β Β Β  Barry JonesΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  [email protected]Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  +44 20 7877 2041Β Β Β Β Β Β  x102Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Gerard Bondur

 

Note: For this report, you may need to query more than one table (join).

If the query does not return any rows, display a proper message:

There is no employees’ information to be displayed.

Note: For each query in your assignment, make sure you handle the errors and display the proper message including the error_code.

Error_code is a number returned if the query execution is not successful.

1 file Β· 1.1 MB

  • Assignment01-barnge.zip 1.1 MB