Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

During this lab period, complete the following. Check out with one of the TAs showing your MATLAB workspace and m-file for the codes. Turn

 

imageimage

During this lab period, complete the following. Check out with one of the TAs showing your MATLAB workspace and m-file for the codes. Turn in a .pdf file or .txt file with your answers to the following questions, and your m-files for your code on Canvas. Look at the submission template on Canvas to better understand how your file should look. 1. Write a script that asks a user a set of questions and then determines and displays the car insurance premium for that person based on their answers to the questions. Car insurance premiums are calculated based on the following table: Premium formula Gender Age Male Under 21 1500+200*(number of speeding tickets) Male 21 to 29 1200+150*(number of speeding tickets) Male Over 29 1000+100*(number of speeding tickets) Female Under 21 1300+ 200*(number of speeding tickets) Female 21 & over 900+100*(number of speeding tickets) Deliverables (write these on your assignment when you turn it in): (a) Calculate your insurance premium. (b) Have one of the TAs use your program to calculate their insurance premium. Lab 3 MENG-210L 2. Piecewise functions are useful when the relationship between a dependent and an independent variable cannot be adequately represented by a single equation. For example, the velocity of a particular rocket can be described by: 2 v(t) = 10t - 5t 0 2 Pre-Lab Complete the following and turn in at the beginning of the lab period: 1. When should you use a switch statement vs. an if statement? 2. When is an elseif statement used? In the next lab, we will cover loop statements. However, in this lab we need to use for loop. A simple syntax for for loop is: 3. for index = values statements end = Use a for loop to write a pseudocode to display all values of vector V [9, 3, 5, 1, 7] separate lines. (hint: index all existing positions in vector V) 4. 5. Write pseudocode and a flowchart for Problem 1 in the lab assignment. Write pseudocode and a flowchart for Problem 2 in the lab assignment.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Mechanical Engineering questions

Question

Discuss Targets channel management procedures.? P-968

Answered: 1 week ago