Concept explainers
Available Credit
The following steps should be followed in a
1. Display the message “Enter the customer’s maximum credit.”
2. Wait for the user to enter the customer’s maximum credit.
3. Display the message “Enter the amount of credit used by the customer.”
4. Wait for the user to enter the customer’s credit used.
5. Subtract the used credit from the maximum credit to get the customer’s available credit.
6. Display a message that shows the customer’s available credit.
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
EBK STARTING OUT WITH C++
Additional Engineering Textbook Solutions
Electric Circuits. (11th Edition)
Automotive Technology: Principles, Diagnosis, And Service (6th Edition) (halderman Automotive Series)
Database Concepts (8th Edition)
Starting Out with C++: Early Objects (9th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Introduction To Programming Using Visual Basic (11th Edition)
- 18. Tom and Jerry opened a new lawn service. They provide three types of services: mowing, fertilizing, and planting trees. The cost of mowing is $35.00 per 5,000 square yards, fertilizing is $30.00 per application, and planting a tree is $50.00. Write an algorithm that prompts the user to enter the area of the lawn, the number of fertilizing applications, and the number of trees to be planted. The algorithm then determines the billing amount. (Assume that the user orders all three services.) (9)arrow_forwardDraw hierarchy charts or flowcharts that depict the programs described below. Sales TaxDesign a hierarchy chart or flowchart for a program that calculates the total of aretail sale. The program should ask the user for:– The retail price of the item being purchased– The sales tax rateOnce these items have been entered, the program should calculate and display:– The sales tax for the purchase– The total of the salearrow_forwardInterest Rates Savings accounts state an interest rate and a compounding period. If theamount deposited is P, the stated interest rate is r, and interest is compounded m timesper year, then the balance in the account after one year is P⋅(1+rm)m. For instance, if$1000 is deposited at 3% interest compounded quarterly (that is, 4 times per year), thenthe balance after one year is1000⋅(1+.034)4=1000⋅1.00754=$1,030.34.Interest rates with different compounding periods cannot be compared directly.The concept of APY (annual percentage yield) must be used to make the comparison. TheAPY for a stated interest rate r compounded m times per year is defined byAPY=(1+rm)m−1.(The APY is the simple interest rate that yields the same amount of interest after oneyear as the compounded annual rate of interest.) Write a program to compare interestrates offered by two different banks and determine the most favorable interest rate. SeeFig. 4.24.arrow_forward
- c++arrow_forwardC language The program should allow users to add, subtract, multiply, and divide fractions. The program should display a menu and prompt the user for a mathematical operation, until they enter 5 to exit. The menu should give the user the option to add, subtract, multiply or divide fractions, or exit. After the user chooses their option, they should be prompted to input two fractions. The result of the arithmetic should then be displayed to the screen. Requirements main()Functionality: This main function should prompt the user for a menu option until they enter 5. If the user doesn't choose Option 5 to end the program, it should get two fractions from the user. It should decide, based on the menu option which actions to perform on the fractions. Option 1 adds the two fractions together. Option 2 subtracts the first fraction from the second. Option 3 multiplies the two fractions together. Option 4 divides the first fraction by the second one. In addition to the main functions, your…arrow_forwardObjectives: • Provide a game solution using C++ language. It is important that we can use a set of C++ features to solve problem. • Develop solutions that use class features for C++. • Create "*.h" files and "*.cpp" files for classes. Description: 1. Part 1- Required Assignment: a. Write code for the class GamePurse. It has the following interface Iclass GamePurse { int purseAmount; public: GamePurse(int); void win(int); void Loose(int); int GetAmount(); }; b. Win() function will add a winning amount to the purseAmount. On the other hand, Loose function will deduct an amount from the purseAmount. GetAmount() will return the value of "purseAmount". c. Write a program that allows you to play the dice game repeatedly until the user chooses to quit. User needs to bet a positive amount to play a game. d. The output of the program may be like the following Welcome to the dice ware game. You have 100 in your game purse.arrow_forward
- An online music and apps store offers all apps for 3$ each and all songs for 7$ each. The store requires members to prepay any amount of money they wish, and then download as many apps or as many songs accordingly. You are required to write a program that would ask the user for the amount that he/she will pay, then display two messages indicating: -the maximum number of apps that can be downloaded, and how much funds will remain in the account after that, if any. -the maximum number of songs that can be downloaded, the number of apps that can be downloaded after that if funds allow, and how much funds will remain in the account after that, if any. Notice the parenthesis in app(s) and song(s) in the output. For this assignment, assume that the user will always enter a valid integer value that is >= 0, and within the limit of the integer range. Here is an example of how your program should behave (the value (shown in bolded italic for clarification purpose only) is entered by the…arrow_forwardconditional structures Create a program that will ask for the username and password.USER NAME:PASSWORD:Note:a. Correct username and password combination, display “You entered a valid username and password combination” and “Access Granted”.b. Incorrect username and/or password combination, display “Please check your input”, “Username and/or the password is invalid”, and “Access Denied”.arrow_forwardProgramming Language: PHP 1. Create a program using if, ifelse, else statement that will ask the user to input two integers. • If the first Integer is less than the second integer, get the product of the two input If both integers are equal get the sum of two inputs. Otherwise, divide the integer and get the remainder as output. 2. Create a program using switch statements that will ask the user to input an integer. • If the first Integer is less than 10, get the product of the two input If the first integer is equal to 1O, get the sum of two inputs. . Otherwise, divide the integer to 10 and get the remainder as output.arrow_forward
- Instructions Instructions Write a program that prompts the user to enter two integers. The program outputs how many numbers are multiples of 3 and how many numbers are multiples of 5 between the two integers (inclusive).arrow_forwardStandard Voltage Classification The Philippine Grid Code and Philippine Distribution Code define the following voltage levels: Low Voltage: a voltage level not exceeding 1kV Medium Voltage: exceeding 1 kV up to 34.5 kv High Voltage: exceeding 34.5 kV up to 230 kV Extra High Voltage: exceeding 230 kV up to 765 kv Ultra High Voltage: exceeding 765 kV (assumed) Make a Matlab program that will ask the user to input a voltage value in kV and the program will classify it according to the standard voltage classification Sample Output: >>voltlvl Input a voltage value in kV: 138 138 kV is a high voltage levelarrow_forwardA software company sells a package that retails for $99. Quantity discounts are given according to the following table: Qt: 10 -19 Discount: 10% Qt: 20 -49 Discount: 20% Qt: 50 -99 Discount: 30% Qt: 100 or More Discount: 40% Write a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount. Python programming questionarrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning