C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 1, Problem 20SA

Explanation of Solution

Algorithm:

  1. Get balance, the amount in the account of the user.

  2. Prompt the user to enter the amount to be withdrawn amount.

  3. Determine if the amount withdrawal is allowed using the following formula and store the result in allowed:

    If (amount is more than 500 or balance is zero or balance is negative)

          Print “You are not allowed to withdraw more than $500 per day“

       allowed = false

    otherwise

            allowed = true

  4. deduction = 0 (suppose deduction is the amount by which the account balance will be finally deducted)

  5. Calculate serviceCharge and deduction using the following formula:

     If (allowed is equal to true)

        If (balance < amount)

        Print "Insufficient balance, withdrawal with service charge of $25.00"

         Get choice to withdraw

            if (choice is Yes)

               serviceCharge = 25...

Blurred answer
Students have asked these similar questions
An ATM allows a customer to withdraw a maximum of $500 per day. If a customer withdraws more than $300, the service charge is 4% of the amount over $300. If the customer does not have sufficient money in the account, the ATM informs the customer about the insufficient fund and gives the option to withdraw the money for a service charge of $25.00. If there is no money in the account or if the account balance is negative, the ATM does not allow the customer to withdraw any money. If the amount to be withdrawn is greater than $500, the ATM informs the customer about the maximum amount that can be withdrawn. Write an algorithm that allows the customer to enter the amount to be withdrawn. The algorithm then checks the total amount in the account, dispenses the money to the customer, and debits the account   by the amount withdrawn and the service charges, if any.
ShopIt is an online merchandise provider that charges their shipping fee based on the number of items purchased. If a single item is purchased, the shipping charge is $4.99. When customers purchase between 2 and 5 items, they are charged the initial $4.99 for the first item and then $3.99 per item for the remaining items. For customers who purchase more than 5 items but less than 15, they are charged the initial $4.99 for the first item, $3.99 per item for items 2 through 5, and $3.49 per item for the remaining items. If they purchase 15 or more items, they are charged the initial $4.99 for the first item, $3.99 per item for items 2 through 5, and $3.49 per item for items 6 through 14, and then just $1.99 per item for the remaining items. Allow the user to enter the number of items purchased. Design the logic of the program using pseudocode. Display the number of purchased items and the shipping fee. The program will continuously run until the user enters zero for the number of…
AITAM LIBRARY MANAGEMENT SYSTEM AITAM Public Library is the biggest library in Koforidua. Currently, it has about 300 members. A person who is 18 or above can become a member. There is a membership fee of GHC400 for a year. There is a form to be filled in which person fills personal details. These forms are kept in store for maintaining members’ records and knowing the membership period. A member can issue a maximum of three books. He/she has three cards to issue books. Against each card a member can issue one book from library. Whenever a member wishes to issue a book and there are spare cards, then the book is issued. Otherwise that request is not entertained. Each book is to be returned on the specified due date. If a member fails to return a book on the specified date, a fine of GHC 2 per day after the due return date is charged. In case a card gets lost, then a duplicate card is issued. Accounts are maintained for the membership fees and money collected from the fines. There are…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
Enhanced Discovering Computers 2017 (Shelly Cashm...
Computer Science
ISBN:9781305657458
Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:Cengage Learning