Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

create two fucntions void displayOrderStatus(Connection* conn, int orderId, int customerId); This function calls the customer_order stored procedure to confirm the entered order ID belongs to

create two fucntions

void displayOrderStatus(Connection* conn, int orderId, int customerId);

This function calls the customer_order stored procedure to confirm the entered order ID belongs to the customer. If the value of the second parameter of the customer_order procedure is a non-zero value, the order ID belongs to the customer.

If the value of the second parameter of the customer_order procedure is zero, display the following message:

"Order ID is not valid."

If the order ID is valid, call the display_order_statusprocedure to receive the order status stored in the second parameter of this stored procedure. If the order status is null, display the following message:

"Order does not exist."

If the status is not null, display a proper message.

See the sample message:

"Order is shipped."

void cancelOrder(Connection* conn, int orderId, int customerId);

This function calls the cancel_orderstored procedure to confirm the entered order ID belongs to the customer. If the value of the second parameter of the customer_order procedure is a non-zero value, the order ID belongs to the customer.

If the value of the second parameter of the customer_order procedure is zero, display the following message:

"Order ID is not valid."

0: The order does not exit.

1: The order has been already canceled.

2: The order is shipped and cannot be canceled.

3: The order is canceled successfully.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Systems A Programmers Perspective

Authors: Randal E. Bryant, David R. O'Hallaron

3rd Global Edition

1292101768, 978-1292101767

More Books

Students also viewed these Databases questions

Question

Identify the six control activities that apply to most companies.

Answered: 1 week ago

Question

Be honest, starting with your application and rsum.

Answered: 1 week ago