Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started