create two fucntions void displayOrderStatus(Connection* conn, int orderId, int customerId); This function calls the customer_order stored procedure
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 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.
Computer Systems A Programmers Perspective
ISBN: 9781292101767
3rd Global Edition
Authors: Randal E. Bryant, David R. O'Hallaron