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 21RQ
Write a MATLAB program that will allow the student to select the grade earned in a course from a menu (with the options of earning an A, B, C, D, or F) that will display the numerical range for the selected grade. The output of the program displayed on the screen should be formatted as shown in the sample output. In your program, you must use a switch statement instead of an if-else if statement. Use the standard 10-point grading scale shown in the previous problem.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Hi I need help to make the line change into a different color, I half of the line to be orange and I need the other half of the line towards the end to be purple as shown in the picture. Also I need there be a box saying Diesel, petrol, diesel best fit, petrol best fit. This part is also shown in the graph.
Please use this code and fix it in MATLAB:
% Sample data for Diesel and Petrol cars
carPosition = linspace(1, 60, 50); % Assumed positions of cars
% Fix the random seed for reproducibility
rng(50);
% Assumed positions of cars
CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel
CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol
% Fit polynomial curves
pDiesel = polyfit(carPosition, CO2Diesel, 3);
pPetrol = polyfit(carPosition, CO2Petrol, 3);
% Generate points for best fit lines
fitDiesel = polyval(pDiesel, carPosition);
fitPetrol = polyval(pPetrol, carPosition);
% Combine the best fit lines
combinedFit =…
Hello I’m trying to make the graph that you see in the picture, I’m trying the exact copy of that graph using this code but I’m having a hard time doing that. Could you change the code so that it looks like the graph that you see on the picture using MATLAB, please send the code when you are finished.
% Sample data for Diesel and Petrol cars
carPosition = linspace(1, 60, 50); % Assumed positions of cars
% Fix the random seed for reproducibility
rng(45);
% Assumed positions of cars
CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel
CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol
% Fit polynomial curves
pDiesel = polyfit(carPosition, CO2Diesel, 3);
pPetrol = polyfit(carPosition, CO2Petrol, 3);
% Generate points for best fit lines
fitDiesel = polyval(pDiesel, carPosition);
fitPetrol = polyval(pPetrol, carPosition);
% Plotting the data
figure; hold on;
scatter(carPosition, CO2Diesel, 'o', 'MarkerEdgeColor', [1 0.5…
Could you please fix my code it’s supposed to look like the graph that’s on the picture. But the lines do not cross eachother at the beginning. Could you make the lines look like the lines on the graph?
Use this code in MATLAB and fix it.
% Sample data for Diesel and Petrol cars
carPosition = linspace(1, 60, 50); % Assumed positions of cars
% Define your seed here
seed = 50;
rand('seed',seed); % Set the seed for reproducibility
% Assumed CO2 emissions for Diesel and Petrol
CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel
CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol
% Fit polynomial curves with a reduced degree of 2
pDiesel = polyfit(carPosition, CO2Diesel, 2);
pPetrol = polyfit(carPosition, CO2Petrol, 2);
% Generate points for best fit lines
fitDiesel = polyval(pDiesel, carPosition);
fitPetrol = polyval(pPetrol, carPosition);
% Plotting the data
figure;
hold on;
% Plot Diesel best fit line…
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
- I need the answers to this part, I have submitted this question twice on this site and both times received way different answers...as I am unsure which tutor to listen to, I am uploading this question for the third time and I am asking a very highly knowledgable tutor to help me solve this. If you are uncertain, please leave it for another tutor.arrow_forwardPlease make the exact graph that you see in the picture, along with the graph are numbers that are data. Please make the exact graph do not make anything thing different, the blue and orange circles should be there and the lines should be the same including the titles. Please make sure everything is exactly the same. Use MATLAB, and send the code and please make sure no error signs comes up. Take your time please I need help.arrow_forwardI need help with the purple line the line that you see one the graph on the picture needs to be on the graph. Use this code to add the purple line and make sure it’s crossing the orange line. Please make sure the lines are positioned the same way it is shown on the picture with the graph. Use this code on MATLAB and add the purple line. % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Use the 'seed' function instead of 'rng' seed = 50; % Define your seed here rand('seed',seed); % Assumed CO2 emissions for Diesel and Petrol CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol % Fit polynomial curves with a reduced degree of 2 pDiesel = polyfit(carPosition, CO2Diesel, 2); pPetrol = polyfit(carPosition, CO2Petrol, 2); % Generate points for best fit lines fitDiesel = polyval(pDiesel, carPosition);…arrow_forward
- Please provide the correct matlab code for the following question.arrow_forwardDon't use chatgpt will upvotearrow_forwardHi, I need help with the first part of the problem below because I'm very confused about how P1 and P2 should be calculated. If you look at my notes to solve the problem there is already a formula in place as I always thought the Patm should also be multiplied by the Area in the numerator, but it's not if I look at this specific tutorial solution given by my course but it's not explained why. I have done a while ago a very similar problem with using that formula in my notes and it gave me the right results, but it's not working for this one. Could you please help me understand why as I have a test coming soon? Figure Q3 (see image attached) shows a cylinder and pistonenclosing air, the movement of the pistonbeing restrained by a compression spring ofstiffness 20 kN/m. The air is heated andexpands, the piston moving 0.3 m. Thefree length of the spring is 1.0 m.Calculate the work done by the air duringthe process.If the pressure , volume and internal energyof air are related by the…arrow_forward
- For Questions 3 and 4: A cup of water was heated to a temperature of 90°. It was placed in a refrigerator that had a temperature of 11°C. The water cooled to a temperature of 17°C in 30 minutes. Let the following variables represent the relevant quantities. L = Temperature of the liquid S= Temperature of the surroundings t = Time B = Initial temperature of the liquid (Temperature at t = 0 k = Cooling constant 3. Using the Equation Solver, find the value of k in the equation L = (B - S)e -kt + S. Remember to set the equation equal to zero and then enter it into the Solver.arrow_forwardI need the answers to this part, I have submitted this question three times on this site and all three times received way different answers...as I am unsure which tutor to listen to, I am uploading this question for the third time and I am asking a very highly knowledgable tutor to help me solve this. If you are uncertain, please leave it for another tutor.arrow_forwardThere is a small space between the orange and purple line could you please connect the two lines together also can you please make the purple line shorter and then connect the purple line to the orange line, please take out the box that says “Diesel, petrol, Diesel best fit, petrol best fit”. Also when ever I run this code the graph shows up but there are still errors that comes up could you please fix them when you are running this on MATLAB. Please use this code on MATLAB and fix it. % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Fix the random seed for reproducibility rng(50); % Assumed CO2 emissions for Diesel and Petrol CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol % Fit polynomial curves pDiesel = polyfit(carPosition, CO2Diesel, 3); pPetrol = polyfit(carPosition, CO2Petrol, 3); % Generate…arrow_forward
- For the air compressor shown in Figure below, the air enters from a large area and exit from small one, explain why? Instructions for answering this question: The answer to this questian is required as handwritten where you are aiso required to add a Handwritten integrity Statement. Pieose follow the below steps: 1 Write on a blank poper your AUM student ID, full name, course code, section and date 2 Write the following integrity statement and sign: "7 offirm that I have neither given nor received any help on this assessment and that personally compieted it on my own." 3. Write your onswer to the obove question as required 4. Put your Original Civil ID card or AUM ID card on the poper 5 Toke o picture or scan, and uplood Important note: if handwritten document is submitted without the integrity stotement including ID (Civil ID or AUM ID), then the related handwritten question(s) will not be groded.arrow_forwardPlease show your solution and at the same time BOX and SPECIFY the answers that corresponds to each blank on the question. Make sure to fill all the blanks. Thank you. STRICKLY FOLLOW THIS: Calculated Answers Express your answers without rounding off and without scientific notation unless instructed otherwise. Multiple Blanks Write powers or subscript as is. Ex: Use b2 if you mean b2 or b2 Spell out Greek letters. Ex: Use pi if you mean greek letter pi Write answers without spaces. Ex: Use 2epsilon0r3 if you mean 3e0r3 Write fractions with a slash. Ex: Use 1/2arrow_forwardplease help solve A-F. thank you You are an engineer working on a project and your prototype has failed prematurely. You question whether or not a key component of the prototype was manufactured with the correct material. There are two way to check for the material properties. The first way is to have a material certification done to confirm the exact material composition. This will take some time. The second method to confirm the material properties is to make an ASTM test sample and test for the material properties. This tensile test was completed on a test sample with an initial diameter of .501” and an initial length of 2”. The Load-Deflection data for this tensile test is below. Use this data to answer the first set of questions on the Final Exam in eLearning. A. Determine the Ultimate Tensile Strength B. Determine the 0.2% Offset Yield Strength C. Determine the value of the Proportional Limit D. Determine the Modulus of Elasticity E. Determine the Strain at Yield F. Calculate %…arrow_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
Introduction to Diffusion in Solids; Author: Engineering and Design Solutions;https://www.youtube.com/watch?v=K_1QmKJvNjc;License: Standard youtube license