Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
3rd Edition
ISBN: 9780133593211
Author: Elizabeth A. Stephan, David R. Bowman, William J. Park, Benjamin L. Sill, Matthew W. Ohland
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 19, Problem 5ICA
What is stored in variable A after each of the following code segments is executed? If the program returns an error, indicate why.
- a. A=5;
if A/2>2
A= A*–1;
else
A = A/2;
End
- b. x=2; y=4; A=0;
if x + y<4
A= A+2;
elseif x+y <6
A = A + 4;
end
- c. T=6; A=–1;
if T/3>2
A = A*–1;
elseif T/3<=2
A = A+2;
end
- d. x=2; y=0; A=10;
if x<=0&&y<=0
A = A+2;
elseif x>=D&&y<0
A = A/2;
elseif x>=2&&y<=0
A = A*2;
end
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
I having a problem with my code in MATLAB. In the following code results for r is just a 1x3 matrix. Although inside the while loop r equals to multiple 1x3 matrices. I need r equal to one matrix that is of size 27032x3. So, I just need the multiple r matrices to merge together to get one big matrix. I need that matrix to retain its value outside the while loop as well.
cc=0; % set line counter
JD = 2460626.666667;
fid = fopen('tle_catalog.txt'); % load the TLE
tline2='gg';
while ischar(tline2)
cc = cc+1; % counter
name = fgets(fid);% for the ones with three lines
tline1 = fgets(fid); % collect first line of two line elements
tline2 = fgets(fid); % collect second line of two line elements
if tline2>0 % stop at the end of the file
% initialize the propagation
[satrec, startmfe, stopmfe, deltamin] ...
= twoline2rv(721, tline1, tline2, 'c', 'd');
time_JD = tline1(21:32);
yeardayhour = str2double(regexp(tline1, '(\d{2})(\d{3})(\.\d+)', 'tokens', 'once'));
dn =…
Q3:
Write two G-code programs using the following figure where units are in inches.
a. The first program should use absolute positioning, and
b. the second program should use incremental positioning.
P4
Finish
(6, 4)
P2
(1, 3)
P3 (4.79, 2)
P1
Start (-2, 1)
Center (2.5, 1)
-2
Write the G-code with describe each lines :
20.0
40.0
40.0
40.0
60.0
30.0
Chapter 19 Solutions
Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
Ch. 19.1 - Prob. 1CCCh. 19.2 - Prob. 2CCCh. 19.2 - Prob. 3CCCh. 19.3 - Write MATLAB code to represent the following...Ch. 19.3 - Prob. 5CCCh. 19.3 - Prob. 6CCCh. 19.4 - A device constructed to throw various objects can...Ch. 19 - Answer the following questions. a. For what...Ch. 19 - Answer the following questions. a. For what...Ch. 19 - For each task listed, write a single MAT LAB...
Ch. 19 - Prob. 4ICACh. 19 - What is stored in variable A after each of the...Ch. 19 - What will be displayed by the following code in...Ch. 19 - Prob. 7ICACh. 19 - Prob. 8ICACh. 19 - Write a program using if-elseif-else statements...Ch. 19 - Write a program using switch-case statements that...Ch. 19 - Prob. 11ICACh. 19 - We go to a state-of-the-art amusement park. All...Ch. 19 - A phase diagram for carbon and platinum is shown....Ch. 19 - The specific gravity of gold is 19.3. Write a...Ch. 19 - An unmanned X-43A scramjet test vehicle has...Ch. 19 - A rod on the surface of Jupiter's moon Callisto...Ch. 19 - The Eco-Marathon is an annual competition...Ch. 19 - Assume a variable R contains a single number....Ch. 19 - Prob. 6RQCh. 19 - Create a program to determine whether a...Ch. 19 - Create a program to determine whether a given Mach...Ch. 19 - Humans can see electromagnetic radiation when the...Ch. 19 - For the protection of both the operator of a...Ch. 19 - Prob. 11RQCh. 19 - Prob. 13RQCh. 19 - Prob. 14RQCh. 19 - Prob. 15RQCh. 19 - Assume you are required to generate the menus...Ch. 19 - Assume you are required to generate the menus...Ch. 19 - Prob. 18RQCh. 19 - Assume you are required to generate the menus...Ch. 19 - The variable grade can have any real number value...Ch. 19 - Write a MATLAB program that will allow the student...Ch. 19 - One of the 14 NAE Grand Challenges is Engineering...Ch. 19 - Prob. 23RQ
Knowledge Booster
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
- 5. Please give the definition and syntax for G00 and G28, and draw the toolpath and mark the passing point coordinate positions in XOY coordinate plane in the following two pictures separately after the code blocks being executed. G00 X6.0 Y3.0 Finish postion(6,3) Start postion (0,0) G91 G28 X0.0 Z2.0 Home postion (6,3) Start postion (0,0)arrow_forwardManipulated variable is the variable which is used to maintain the output at setpoint. Select one: True Falsearrow_forwardNonearrow_forward
- write one command for each case: take data name is 'x' and file name is 'database' Import data form Excel sheet to MATLAB. 1. Export data form MATLAB to Excel sheet. 2. Save data as text file. 3. Load data form text file. 4. Open and close file.arrow_forwardneed relative coordinates, pleasearrow_forwardPlease draw 5 and 6arrow_forward
- 3. Convert C/C++ code to MIPS Code #include using namespace std; main () { int x, y, sum; x = 50; y = 60; %3D sum = x + y; cout << "Sum is: " « sum << endl; }arrow_forwardQ2: Write all the necessary steps to draw the following figure using relative coordinate system. For example; the draw of (L1, L2) as following > Dynamic input > of > Home> Draw> Line> 50,50>Enter>@100,0>Enter> @0,50 > Enter> and so on 100 100 100 100 A L1 L2 Start Point (50,50) 100 200 100 007 000 007arrow_forwardWhat is the error in the following code: x=[1:1:10]; y=[ 21 33 4 56 77 88 990 ; semilogy (x, y,'r--'); vectors must be the same lengths can't draw by semilogy x in not a vector there is no any error matlab (w = [1 0-9; 2 -2 0; 1 2 3]; ). What is the value of x(2,1) ? undefined O 2 O the whole second rowarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY
The Robot Revolution: The New Age of Manufacturing | Moving Upstream; Author: Wall Street Journal;https://www.youtube.com/watch?v=HX6M4QunVmA;License: Standard Youtube License