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.
Read 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 Java
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Big Java Late Objects
Additional Engineering Textbook Solutions
Modern Database Management
Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Python (3rd Edition)
Java: An Introduction to Problem Solving and Programming (7th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
- A complex number is a number in the form a+bi, where a and b are real numbers and i is √(-1) The numbers a and b are known as the real part and imaginary part of the complex number, respectively. You can perform addition, subtraction, multiplication, and division for complex numbers using the following formulas: a + bi + c + di = (a+c) + (b+d)i (addition) a + bi − (c + di) = (a−c) + (b−d)i (subtraction) (a + bi) * (c + di) = (ac−bd) + (bc+ad)i (multiplication) (a + bi) / (c + di) = (ac+bd) / (c2+d2) + (bc−ad)i / (c2+d2) (division) You can obtain the Absolute Value for a complex number using the following formula: |a + bi| = √(a2 + b2) A Complex number can be interpreted as a point on a plane by identifying the (a,b) values as the coordinates of the point. The absolute value of the complex number corresponds to the distance of the point to the origin, as shown in the example below. (1) Design a class named Complex for representing complex numbers Include…arrow_forwardA complex number is a number in the form a + bi, where a and b are real numbers and i is sqrt( -1). The numbers a and b are known as the real part and imaginary part of the complex number, respectively.You can perform addition, subtraction, multiplication, and division for complex numbers using the following formulas:a + bi + c + di = (a + c) + (b + d)ia + bi - (c + di) = (a - c) + (b - d)i(a + bi) * (c + di) = (ac - bd) + (bc + ad)i(a+bi)/(c+di) = (ac+bd)/(c^2 +d^2) + (bc-ad)i/(c^2 +d^2)You can also obtain the absolute value for a complex number using the following formula:| a + bi | = sqrt(a^2 + b^2)(A complex number can be interpreted as a point on a plane by identifying the (a, b) values as the coordinates of the point. The absolute value of the complex number corresponds to the distance of the point to the origin, as shown in Figure 13.10.)Design a class named Complex for representing complex numbers and the methods add, subtract, multiply, divide, and abs for performing complex…arrow_forwardA retail company assigns a $5000 store bonus if monthly sales are more than $100,000; otherwise a $500 store bonus is awarded. Additionally, they are doing away with the previous day off program and now using a percent of sales increase to determine if employees get individual bonuses. If sales increased by at least 4% then all employees get a $50 bonus. If they do not, then individual bonuses are 0. Step 7: The final step in completing the pseudocode is to call all the modules with the proper arguments. Complete the missing lines. Module main () //Declare local variables Declare Real monthlySales Declare Real storeAmount Declare Real empAmount Declare Real salesIncrease //Function calls Call getSales(monthlySales) Call getIncrease(salesIncrease) Call ______________(_______________, _____________) Call ______________(_______________, _____________) Call ______________(_______________, _____________) End Modulearrow_forward
- Program by using C # C sharp My student number :1910206534arrow_forwardCreate an algorithm for a basic calculator that will perform the sum, difference, product, and quotient of two numbers. Your program should let the user choose which operation.arrow_forward Binary-Decimal / Decimal Binary . Between 0 and 255 a number will be decided randomly by computer. Then asks to user 3 times a random digit of binary value of the that number. If user enters wrong number for a digit program will select another random number and ask random times random digit. Every time user enters input will be counted as one hour in that planet. For example: Computer selected number as 163 ( Which is 10100011) What is the digit 2 (question 1/3) :User enter 1 CorrectWhat is the digit 4 (question 2/3) : User enter 0 CorrectWhat is the digit 7 (question 3/3) : User enter 0 CorrectUser finished the quest with 3 input .arrow_forward
- Airline companies apply baggage restrictions for their passengers. An airline company has decided to apply a 10kg limitation for passengers' hand luggage and 20kg for their normal baggage. When passengers arrive, they enter their hand and normal luggage weight from the keyboard. If passengers exceed their normal baggage allowance of 10 dollars per gram, they pay 12 dollars per kg. Accordingly, write the program that calculates the baggage price of the airline they will go to according to the baggage values entered by the arriving passenger and keeps this from closing the program for each passenger. Note: If hand and normal baggage allowances are stretched below the maximum value, the payment amount will be considered not negative. An example printout is given on the right. Geri bildirim gönderarrow_forwardSlove by pythonarrow_forwardwrite a program that will calculate the total sales amount including the amount for state and county sales tax. Assume the state sales tax is 5 percent and the county sales tax is 2.5 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale. Follow this algorithm when you write 3) your program: • Step 1: Ask user to input purchase amount • Step 2: Calculate state tax, county tax and total sales. Use the following formula: state_tax - purchase * .05 county_tax = purchase *.025 total sales - purchase + state_tax + county_taxarrow_forward
- IN pseudocode Write a program that requires you to calculate a shop’s total money in a specific register. Allthe different notes should be added to calculate how much money is in the register. The coinsare added together manually and then added to the total. Required input values are:o The amount of 10 rand notes.o The amount of 20 rand notes.o The amount of 50 rand notes.o The amount of 100 rand notes.o The amount of 200 rand notes.o The total of the coins.The output is the total cash in the register.arrow_forwardThe profit from the sale of a stock can be calculated as follows: Profit ((NS SP) SC) ((NS PP) PC)where NS is the number of shares, SP is the sale price per share, SC is the sale commission paid, PP is the purchase price per share, and PC is the purchase commission paid. If the calculation yields a positive value, then the sale of the stock resulted in a profit. If the calculation yields a negative number, then the sale resulted in a loss.Write a function that accepts as arguments the number of shares, the purchase price per share, the purchase commission paid, the sale price per share, and the sale commission paid. The function should return the profit (or loss) from the sale of stock.Demonstrate the function in a program that asks the user to enter the necessary data and displays the amount of the profit or loss.arrow_forwardCollatz Sequence: In 1937, Lothar Collatz proposed that no matter what number you begin with, the sequence eventually reaches 1. This is widely believed to be true but has never been formally proved. Write a program that inputs a number from the user, and then displays the Collatz Sequence starting from that number. Stop when you reach 1. If n is even, divide it by 2 to get n / 2. If n is odd, multiply it by 3 and add 1 to get 3n + 1. Repeat the process indefinitely. Find out and print the maximum number that you can get in these calculations. ' Part-3: Please enter a number: 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1 The maximum number you get: 9232arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT