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)
- 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_forwardQI\ AFind the value of the complex number (1- i) ?arrow_forwardCodes to start with: (many errors and bugs to be corrected)m=30;n=m*m;x=linspace(0,1,m);y=linspace(1,0,m);k=10;a=zeros(n,n);b=zeros(n);c=zeros(n);d=zeros(m,m);%interior pointsfor jj=?a(jj,jj)=-4;a(jj,jj-2*m)=1;a(jj,jj+2*m)=1;a(jj,jj-2)=1;a(jj,jj+4)=1;end%top bcfor jj=1:ma(jj,jj)=1;end%bottom bcfor jj=?a(jj,jj)=1;end%left bcfor jj=?a(jj,jj)=-4;a(jj,jj-m-5)=1;a(jj,jj+m-2)=1;a(jj,jj+4)=2;end%right bcfor jj=?a(jj,jj)=-4;a(jj,jj-m)=1;a(jj,jj+m)=1;a(jj,jj-1)=2;endfor jj=1:mb(jj)=30;endfor jj=?b(jj)=50;endfor jj=?b(jj)=-20000/k/m*cos(pi*((m-1)*m-jj+1)/m/m);endc=inv(a)*b;%try to plot c in 2d domainfigurecontourf(x,y,d)title('Temperature')xlabel('Distance x')ylabel('Distance y')arrow_forward
- READ THE INSTRUCTIONS!!! DO NOT ANSWER THIS IF YOU ALREADY ANSWERED. I WILL DOWNVOTE. ANSWER THIS COMPLETE, CORRECT, TYPEWRITTEN. I WANT IT TO BE DIGITALLY ANSWERED NOT HANDWRITTEN. I WILL UPVOTE IF YOU MEET THESE.arrow_forwardI need help understanding and explaining the answer of this question. (I have attached an image with the question and its corresponding figures) Also, it would help if the explanation could be typed up or written very clearly because many times it can be hard to understand someone's handwriting!arrow_forwardQuestion: What is the radix component for the integer -356? Subject name: Microcomputer engineering Department : mechanical Engineeeringarrow_forward
- s = 2 t = 0arrow_forwardQ4: Create a Visual Basic Project to find the value of the following series: h? h4 h3 cos(h) = h – 2! 3! 4! Write the code program so that the value of angle (h) is entered into inputbox. Estimate the value of series (cos(h)) so that the absolute value of any term is greater or equal to 10-6. Display the required number of terms (N) which it used in this series in a text box and display the result of series (cos(h)) in another separate text box.arrow_forwardQ4/ 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. MATLAB 3. Load data form text file. 4. Open and close file.arrow_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