THINKING LIKE AN ENGINEER W/ACCESS
THINKING LIKE AN ENGINEER W/ACCESS
17th Edition
ISBN: 9781323522127
Author: STEPHAN
Publisher: PEARSON C
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 19, Problem 10RQ

You are to program part of the interface for a simple atm. When the user inserts their card and types the correct pin (you do NOT have to write this part of the program), the system will place the users’ checking account balance balance in a variable CBal and the users’ saving account balance in SBal.

 You are to write a function that will accept SBal and CBal as inputs and return two variables NewCBal and NewCBal containing the checking and savings balances after the transaction is completed. The function should do the following:

  • Display a menu titled “Main Menu” with the following three options.
    • Get cash
    • Get balance
    • Quit
  • If “Get cash” is selected, another menu titled “Withdrawal amount” with the following four items is displayed:
    • $20
    • $60
    • $100
    • $200
  • After selecting an amount, a menu titled “From which amount?” should be displayed showing the following two options:
    • Checking
    • Savings
  • At this point, the program should verify that the selected amount contains sufficient funds for the requested withdrawal.
    • If not, a message should be displayed that says, “Sorry. You do not have sufficient funds in your SSSS account to withdraw $XX” where SSSS is either Savings or Checking and $XX is the selected withdrawal amount.
    • It funds are available, the program should call a function Disp20(x), where x is the number of $20 bills to dispense. (See the following note about Disp20.) After that, the withdrawal amount should be subtracted from the appropriate balance.
    • After processing the “Get cash” request, the program should return to the main menu.

      Note About Disp20(x): The purpose of this function is to dispense the requested number of $20 bills—that is, to shove x bills out of the slot in the ATM machine. This does not really exist since we do not have an ATM machine to work with. Thus, if you try to run your code, you will get an error (“Undefined function..”).

 In order to test your program, add the following function to your current path:

Chapter 19, Problem 10RQ, You are to program part of the interface for a simple atm. When the user inserts their card and

 Where x is the number of bills to be dispensed.

 This allows you to know if the program reached the proper location in the code. It is fairly common in software development to use a “dummy” function in the place of a real one when the device to be controlled has not been completed or is not available in order to help verify whether the software is reaching the correct places in the code for various situations.

  • If “Get Balance” is selected, another menu titled “Which account?” should appear with the two choices:
    • Checking
    • Savings

 and the program should then display “Your SSSS balance is $bb.bb.,” where SSSS is either Savings or Checking and $bb.bb is the balance in the selected account.

  • After processing the “Get balance” request the program should return to the main menu.
    • If Quit is selected, the function should return to the calling program with the updated balances in NewCBal and NewSBal. Note that the new balances will be equal to the original balances if no money was drawn from an account, but they must still be returned in the two new balance variables.

 If the user closes a menu rather than making a selection, a warning message should be displayed and the user given two more chances to make a selection from that menu. If they still close the menu on the third attempt, an error message should be displayed and control should return to the main program after making sure that NewCBal and NewSBal were set as appropriate based on earlier transactions.

Blurred answer
Students have asked these similar questions
2. (If relevant) A clearly labeled diagram (or diagrams) clearly pertaining to your analysis with a coordinate system and relevant labels. Final answer with appropriate units and significant figures. You can use the fprintf() command in MATLAB to format numerical results A 2-3 sentence reflection on your answer. Does it make sense? Why or why not? What are some implications?
Learning Goal: To use equilibrium to calculate the plane state of stress in a rotated coordinate system. In general, the three-dimensional state of stress at a point requires six stress components to be fully described: three normal stresses and three shear stresses (Figure 1). When the external loadings are coplanar, however, the resulting internal stresses can be treated as plane stress and described using a simpler, two-dimensional analysis with just two normal stresses and one shear stress (Figure 2). The third normal stress and two other shear stresses are assumed to be zero. The normal and shear stresses for a state of stress depend on the orientation of the axes. If the stresses are given in one coordinate system (Figure 3), the equivalent stresses in a rotated coordinate system (Figure 4) can be calculated using the equations of static equilibrium. Both sets of stresses describe the same state of stress. The stresses σx′and τx′y′ can be found by considering the free-body…
You are recently promoted as the chief traffic management officer of a major city in the country. Based on recent data, you learned that one of the leading causes of road accidents is over speeding.In your desire to minimize road accidents, you went out to observe how traffic management rules are implemented on the streets. Your attention was caught by a fast - moving car that seemed to be breaking the speed limit of 100 kilometers per hour(km/hr.), and so you followed it along the highway. After a short time, the driver of the car noticed you and started to slow down. Eventually, he stopped on the side of the road. Supposed the speed of the car had been noted during this time and is modeled by the quadratic equation y = 3x² + 17x - 20, where y represents the speed of the car in km/hr. and x represents the number of minutes after you started following the car. How long did it take for the car to be under surveillance before it could finally stop on the side of the road? Did the driver…

Chapter 19 Solutions

THINKING LIKE AN ENGINEER W/ACCESS

Ch. 19.3 - Write a for loop to display every even number from...Ch. 19.3 - Write a for loop to display every multiple of 5...Ch. 19.3 - Write a for loop to display every odd number from...Ch. 19.3 - Assume a vector Vals has already been defined....Ch. 19.3 - Consider the following table of values. Determine...Ch. 19.3 - Write two nested for loops to determine how many...Ch. 19.3 - Assume a matrix MZ has already been defined. Write...Ch. 19.3 - Prob. 18CCCh. 19.3 - Determine the output of the following code:Ch. 19 - Prob. 1ICACh. 19 - Create a written algorithm or flowchart as...Ch. 19 - Create a written algorithm or flowchart as...Ch. 19 - Create a written algorithm or flowchart as...Ch. 19 - Create a written algorithm or flowchart as...Ch. 19 - Create a written algorithm or flowchart as...Ch. 19 - Create a written algorithm or flowchart as...Ch. 19 - For each of the following code segments, determine...Ch. 19 - a. Assume CA1 and CA2 are cell arrays that both...Ch. 19 - Fill in the table with the values of k, b, x, and...Ch. 19 - Assume that a simple menu has been created by the...Ch. 19 - Write a MATLAB program to implement the algorithm...Ch. 19 - Write a program that will ask the user to input a...Ch. 19 - Write a MATLAB program to implement the algorithm...Ch. 19 - Write a function named CountDown that accepts a...Ch. 19 - While experimenting with coding sequences, you...Ch. 19 - Answer the question with each of the following...Ch. 19 - For each of the following code segments, determine...Ch. 19 - a.Explain what the following function does,...Ch. 19 - For each of the following code segments, determine...Ch. 19 - Prob. 23ICACh. 19 - Prob. 24ICACh. 19 - Write a MATLAB program to implement the algorithm...Ch. 19 - Prob. 26ICACh. 19 - Write a function named GetArray that will accept...Ch. 19 - Assume the vector AM contains an even number of...Ch. 19 - Write a function named EvenSum that will accept a...Ch. 19 - Prob. 30ICACh. 19 - Write a function named CLASS that will accept a...Ch. 19 - You are assessing the price of various components...Ch. 19 - You are studying the number of defective parts...Ch. 19 - The pascal triangle an amazing number of uses,...Ch. 19 - Write a function named Prodstate that will accept...Ch. 19 - Design a flowchart for a program to help students...Ch. 19 - Create an algorithm to allow the user to enter a...Ch. 19 - Write a program to implement the algorithm...Ch. 19 - A zombie picks up a calculator and starts adding...Ch. 19 - Write a function called Balloon that will accept a...Ch. 19 - Prob. 7RQCh. 19 - Prob. 8RQCh. 19 - You are to program part of the interface for a...Ch. 19 - Prob. 13RQCh. 19 - A matrix names mach contains three columns of data...Ch. 19 - Prob. 15RQCh. 19 - You are programming the control system for a robot...Ch. 19 - Write a program to implement the GPA calculator...Ch. 19 - The Fibonacci sequence is an integer sequence...Ch. 19 - As early as 650 BC, mathematicians have been...Ch. 19 - Write a program to analyze the cooling of a cup of...Ch. 19 - After numerous experiments with a circuit...
Knowledge Booster
Background pattern image
Mechanical Engineering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, mechanical-engineering and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
Text book image
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
Text book image
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
Text book image
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
Text book image
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
Text book image
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY
Mechanical Calculations; Author: Mometrix Academy;https://www.youtube.com/watch?v=FiQw8fpUHMY;License: Standard youtube license