Concept explainers
Answer the following questions.
a. For what integer values of D will the code between if and end execute?
if D >= – 1 && 3 > D
code
end
b. For what values of F will the code between if and end execute?
if F >= 100 || F <= 5
code
end
c. What combinations of values for B and Q will cause a warning to be displayed?
if B >100 || (B<20 && Q~=0)
fprintf ('WARNING! Pararneters out of bounds. \n')
end
a.
Find the integer values for which the code inside the if and end executes.
Answer to Problem 1ICA
The integer values for which the code inside the if and end executes are
Explanation of Solution
The English translation of the if statement says that, the if statement is true when the variable D is greater than or equal to -3 and less than 1.
So from the number line, the values of D for which the expression is true are
Conclusion:
Hence, the integer values for which the code inside the if and end executes are
b.
Find the integer values for which the code inside the if and end executes.
Answer to Problem 1ICA
The integer values for which the code inside the if and end executes are
Explanation of Solution
The English translation of the if statement says that, the if statement is true when the variable F is greater than or equal to 100 or less than or equal to 5.
So from the number line, the values of F for which the expression is true are
That is F can be any real number excluding numbers between 5 to 100.
Conclusion:
Hence, the integer values for which the code inside the if and end executes are
c.
Find the integer values for which the code inside the “if” and “end” executes.
Answer to Problem 1ICA
The integer values for which the code inside the “if” and “end” executes are
Explanation of Solution
The English translation of the if statement says that, the if statement is true when the variable B is greater than 100 or when B is less than 20 and Q is not 0.
So from the number line, the values of B and Q for which the expression is true are
Conclusion:
Hence, the integer values for which the code inside the “if” and “end” executes are
Want to see more full solutions like this?
Chapter 19 Solutions
Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
- 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) -2arrow_forwardQ1: write a program to enter any text and compute its length. Q2: Design a form with a text box. Use select statement so that when user enters g, b, r and y then form colored to green, blue, red, and yellow respectively. Q3: Write a program to print multipliers of 5 (from 5 to 50)arrow_forwardUSE: X=3 PLEASE ANSWER QUICKLYarrow_forward
- 4. Please explain the difference between Modal and Non-modal Codes. Think about which G-code can be omitted in the following NC program and sign such G-code with bracket. 00001 N10 G20 G40 G49 G54 G80 G90 N20 M06 T03 N30 G43 H03 N40 M03 S2000 N50 G00 X0.5 Y0.5 N60 G00 Z0.2 N70 G01 Z-0.1 F5.0 N80 G01 X0.5 Y1.5 F10 N90 G01 X0.5 Y1.5arrow_forwardPls answer correctly and corresponding to what is given in the image attached. The instructions are already in the image. Thank youarrow_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
- In octal (base 8), the 12-bit two's complement of the hexadecimal (base 16) number 2AF16 is? Please show the computation process. Hint: base 16 - base 10 base 2 two's complement of a 12-bit binary string base 10 - base 8arrow_forward5. 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_forwardQI\ AFind the value of the complex number (1- i) ?arrow_forward
- Q2: 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_forwardCNC. Please write what each line of G- code means for each line. Thanksarrow_forwardQuestion: What is the radix component for the integer -356? Subject name: Microcomputer engineering Department : mechanical Engineeeringarrow_forward
- 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