Question

In: Electrical Engineering

Is there a solution for this anywhere?  Chapter 9, Problem 16P, 5th edition, Matlab for engineers

Is there a solution for this anywhere?  Chapter 9, Problem 16P, 5th edition, Matlab for engineers

Solutions

Expert Solution

Matlab Code:

---------------------------------------------------------------------------------------------------------------------------------------------------------

% 9.16 A store owner asks you to write a program for use in the checkout process.

% The program should:

% • Prompt the user to enter the cost of the first item.

% • Continue to prompt for additional items, until the user enters 0.

% • Display the total.

% • Prompt for the dollar amount the customer submits as payment.

% • Display the change due.

clc;clear;

rate = input ('enter the cost of first item = ')

totalCost = 0;

quantity = 1;

while(quantity ~= 0)

  

quantity = input('Enter the no of quntity you want to add = ')

totalCost = totalCost + rate * quantity;

end

sprintf('Total Cost of purchase is = %d',totalCost)

cash = input('Enter the dollar amount to submit as payment = ')

sprintf('The change due is %d',cash - totalCost)

---------------------------------------------------------------------------------------------------------------------------------------------------------


Related Solutions

Chapter 3.6, Problem 20E in Introduction to Linear Algebra (5th Edition) Find the basis for the...
Chapter 3.6, Problem 20E in Introduction to Linear Algebra (5th Edition) Find the basis for the null space and the range of the given matrix. Then use Gram-Schmidt to obtain the orthagonal bases. 1 3 10 11 9 -1 2 5 4 1 2 -1 -1 1 4
research methods for the behavioral sciences 5th edition pdf Chapter 5.   Explain the relationship between a...
research methods for the behavioral sciences 5th edition pdf Chapter 5.   Explain the relationship between a population and a sample. Why is it important that a sample is representative?   In what way can it be problematic to have a too large a sample size? What is the difference between a probability sample and a non-probability sample? Give an example of each. Describe how snowball sampling might overcome some of the limitations of a judgemental sample. Give an example how it...
research methods for the behavioral sciences 5th edition pdf Chapter 8 Identify the main features of...
research methods for the behavioral sciences 5th edition pdf Chapter 8 Identify the main features of a between subject design. Describe one positive and one negative aspect of a between subject design. Describe two threats to internal validity which can arise with the control group when using a between subject design. Identify the advantage of using a multiple (3+) group design.
Principles of Managerial Finance (14th Edition) Chapter 9, Problem 17P An example in Spreadsheet format. Calculation...
Principles of Managerial Finance (14th Edition) Chapter 9, Problem 17P An example in Spreadsheet format. Calculation of individual costs and WACC Dillon Labs has asked its financial manager to measure the cost of each specific type of capital as well as the weighted average cost of capital. The weighted average cost is to be measured by using the following weights: 40 % long-term debt, 15 % preferred stock, and 45 % common stock equity (retained earnings, new common stock, or...
I would like the textbook solution to Auditing & Assurance Services 10th edition Chapter 21 problem...
I would like the textbook solution to Auditing & Assurance Services 10th edition Chapter 21 problem 32P please. There isn't an answer in the textbook solutions. This question has remained unanswered.
Question 17- Chapter 10 (Internet and World Wide Web 5th Edition) You will use random number...
Question 17- Chapter 10 (Internet and World Wide Web 5th Edition) You will use random number generation to develop a simulation for the classic race of the tortoise and the hare. The contenders begin the race at square 1 of 70 squares. Each square represents a possible position along the race course. The finish line is at square 70. The first contender to reach or pass square 70 is rewarded with a pail of fresh carrots and lettuce. The course...
09problem 3/4/2019 20:30 9/14/2015 Chapter 9. Solution for End-of-Chapter Comprehensive/Spreadsheet problem Problem 9-22 Taussig Technologies Corporation...
09problem 3/4/2019 20:30 9/14/2015 Chapter 9. Solution for End-of-Chapter Comprehensive/Spreadsheet problem Problem 9-22 Taussig Technologies Corporation (TTC) has been growing at a rate of 20% per year in recent years. This same growth rate is expected to last for another 2 years, then to decline to gn = 6%. a. If D0 = $1.60 and rs = 10%, what is TTC's stock worth today? What are its expected dividend and capital gains yields at this time, that is, during Year...
Risk Management and Insurance 2nd Edition Chapter 11 Problem 1 Solution. Can you explain how to...
Risk Management and Insurance 2nd Edition Chapter 11 Problem 1 Solution. Can you explain how to do this problem? How did you come up with the marginal cost and marginal benefit numbers? Thank you, Sam
Engineering Mechanics (8th Edition) Chapter 3, Problem 212P
Engineering Mechanics (8th Edition) Chapter 3, Problem 212P  
Java Programming 5th edition Chapter 10 Inheritance Programs Part 1 Number 3 on page 719 which...
Java Programming 5th edition Chapter 10 Inheritance Programs Part 1 Number 3 on page 719 which creates a Point class with 2 instance variables; the xCoordinate and yCoordinate. It should have a default constructor and a values constructor. Also include a set method that sets both attributes, a get method for each attribute, and a method that redefines toString() to print the attributes as follows. point: (x, y) Part 2 Do number 4 on page 719 which creates a Circle...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT