Final answer:
The provided pseudocode has been translated into a C program that reads the total book price and number of books from the user, computes tax and shipping charges, and then calculates and prints the final order price.
Step-by-step explanation:
To translate the provided pseudocode into a C program, we need to follow the steps closely to compute the final price of an order in a bookstore. The steps include reading in the total book price and number of books, calculating tax, calculating shipping charges, and finally, computing the total price of the order.
Here's an example of how the main body of a C program based on the pseudocode might look:
int main() {
float totalBookPrice, orderPrice, tax;
int numOfBooks;
float shippingCharge;
printf("Enter the total book price: ");
scanf("%f", &totalBookPrice);
printf("Enter the number of books: ");
scanf("%d", &numOfBooks);
tax = totalBookPrice * 0.075;
shippingCharge = numOfBooks * 2;
orderPrice = totalBookPrice + tax + shippingCharge;
printf("The price of the order is: $%.2f\\", orderPrice);
return 0;
}
This program will calculate the total price of the bookstore order by adding the total book price, tax, and shipping charge, then print the price of the order to the console.