Question

In: Computer Science

Chapter 2, Business P2.32: The following pseudocode describes how a bookstore computes the price of an...

Chapter 2, Business P2.32: The following pseudocode describes how a bookstore computes the price of an order from the total price and the number of the books that were ordered. Ask user for the total book price and the number of books. Compute the tax (7.5 percent of the total book price). Compute the shipping charge ($2 per book). The price of the order is the sum of the total book price, the tax, and the shipping charge. Print the price of the order. Translate this pseudocode into a Python program. Submission Requirements Please submit this assignment as a .py file. You will need to use the Python IDLE program (Links to an external site.) to test if your code is running specification.

Solutions

Expert Solution

Pseudocode

   START

       DECLARE TotalBookPrice
       DECLARE NumberOfBooks
       DECLARE OrderPrice

       INPUT TotalBookPrice
       INPUT NumberOfBooks

       OrderPrice = TotalBookPrice + (7.5/100)*(TotalBookPrice) + (2 * NumberOfBooks)

       PRINT "Order price is: " + OrderPrice

   END


Python Program
      


"""
    Python program to calculate book order price
"""

totalBookPrice = int(input('Enter total book price: '))
numberOfBooks = int(input('Enter number of books: '))

orderPrice = totalBookPrice + (7.5/100)*(totalBookPrice) + (2 * numberOfBooks)

print('Order price is:', orderPrice)


Related Solutions

[after §3.23 easy] Swapping : The following pseudocode describes a simple algorithm which swaps the values...
[after §3.23 easy] Swapping : The following pseudocode describes a simple algorithm which swaps the values in two variables, x and y: 1 print “Enter initial value of x: ” 2 input x 3 print “Enter initial value of y: ” 4 input y 5 set temp to x 6 set x to y 7 set y to temp 8 print “x = ” x“, y = ” y Write a Java Program that implements this algorithm.
1) Consider the following Java method. Which term best describes what this method computes? static int...
1) Consider the following Java method. Which term best describes what this method computes? static int doSomething(int[] a) {     int b = a[0];     for (int c : a) if (b > c) b = c;     return b; } a. average b. maximum c. minimum d. sum e. transpose 2) Consider the following Java program, what starts on line 2? 1 public class HelloWorld { 2     // My first program! 3     public static void main(String[] args) { 4        ...
Chapter 1 and 2 "The Revolt of Engineers": Layton describes the approaches of the four founder...
Chapter 1 and 2 "The Revolt of Engineers": Layton describes the approaches of the four founder societies of engineering professionals--ASCE, AIME, ASME, and AIEE. In 3-4 sentences, state which of these organizations would be most appealing to you to join based on its membership criteria, stances on professional behavior, and relationship to business, and why. In 1-2 sentences, state which would be least appealing and why?
Once a business computes its cost of capital, discuss how a manager might decide whether to...
Once a business computes its cost of capital, discuss how a manager might decide whether to take on a project or not. How are capital project investments prioritized?
International Business Chapter 12 - Management Focus: Ford’s Global Strategy Summary The Management Focus describes the...
International Business Chapter 12 - Management Focus: Ford’s Global Strategy Summary The Management Focus describes the changes in U.S. automaker Ford’s global strategy after former Boeing executive Alan Mulally was appointed CEO in 2006. At the time, Ford produced models targeted for specific regions of the world. Under Mulally’s leadership, Ford implemented its One Ford strategy that uses just a few car platforms to serve the entire world. Discussion of the closing can revolve around the following questions:   QUESTION 1:...
1. Which of the following best describes a success scenario? - A statement that describes how...
1. Which of the following best describes a success scenario? - A statement that describes how certain decisions lead to success -A statement that defines what it means for the system to perform as intended   -A statement of what could go wrong within a system -A statement of who, what, when, where and how a system would fail 2. Which of the following variable types represent measurable properties of a system itself? -Input Variables -Output Variables -Exogenous Variables    -State Variables...
Prepare a New Business Venture BUSINESS PLAN for a VENDING business, using the following Chapter Headings:...
Prepare a New Business Venture BUSINESS PLAN for a VENDING business, using the following Chapter Headings: 1. General Company Description 2. Products and Services 3. Marketing Plan 4. Operational Plan 5. Management and Organization 6. Personal Financial Statement 7. Startup Expenses and Capitalization 8. Financial Plan 9. Appendices
1. A business's competitive environment describes: A. how a business competes for critical resources. B. how...
1. A business's competitive environment describes: A. how a business competes for critical resources. B. how a business makes its product. C. how a business uses its business model to create a competitive advantage. D. how a business is affected by the overall economy. The net working capital for a company with current assets of $ 68,000, quick assets of $ 30,000 total assets of $ 160,000, current liabilities of $ 47,000 and net sales of $ 76,000 would be:...
4- A- In a short essay describes how the current financial and global business sectors are...
4- A- In a short essay describes how the current financial and global business sectors are being affected by the Covid-19. Give one example locally and two examples internationally.
Tasks 2 Write algorithms in pseudocode to implement a LinkedList The following operations must be performed...
Tasks 2 Write algorithms in pseudocode to implement a LinkedList The following operations must be performed on the LinkedList: *Add an element *Insert an element at a given position x. *Retrieve/Read the value of an element at position y. *Delete an element from position z. (x,y and z represent any value in the valid range of indices of the LinkedList).
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT