Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How would I use if statements to solve this? This is using Matlab Suppose you are responsible for calculating employee salaries for the coming year

image text in transcribed

How would I use if statements to solve this?

This is using Matlab

Suppose you are responsible for calculating employee salaries for the coming year based on their performance rating for this year. You wish to build a function that will automatically calculate the employee's new salary (NewSalary) given their current salary (E_salary) and their performance rating (E_performance). Raises for the next year will be handed out on the following basis: A rating of 8 or above will result in a raise of 5% --> A rating of 5-7 will result in a raise of 3%. A rating of 4 or below will result in no raise. (New Salary = Current Salary*1.05) (New Salary = Current Salary*1.03) (New Salary = Current Salary) --> Write a function BonusCalculator that will: 1. Take 2 inputs: E_salary and E_performance 2. Output the new employee salary called: New Salary Function C Reset 9 MATLAB Documentation 1 function [NewSalary] - BonusCalculator (E_salary, E_performance) 2 % Enter your function code here 3 4 end 5 Code to call your function C Reset 1 [NewSalary1] = BonusCalculator (4230,10) %Testing your function 2 3 [NewSalary2] = BonusCalculator (4230,5) %Testing your function 4 5 [NewSalary3] = BonusCalculator (4230,3) %Testing your function

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

Step: 3

blur-text-image

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago