Question
Using MATLAB. Please new answer, we don't want the same as the below answer clc; clear all ; close all ; Employee_id = zeros(4,1); Name
Using MATLAB.
Please new answer, we don't want the same as the below answer
clc; clear all ; close all ; Employee_id = zeros(4,1); Name = strings(4,1); Salary_Amount = zeros(4,1); Payment_Date = strings(4,1); Salary_Delayed =strings(4,1); t1=floor(now); Current_date=datetime(t1,'convertfrom','datenum') Y='y'; while Y =='y' disp(' welcome to Wage Protection System') for i =1:4 Employee_id(i) = input(' enter the employee id : '); Name(i) = input(' enter the Name of Employee : ' , 's'); j=input(' enter the salary amount : '); if j>1000 Salary_Amount(i) = j; else disp(' Enter the salary amount grater than 1000 '); j=input(' enter the salary amount greater than 1000 : '); Salary_Amount(i) = j ; end Y = input(' enter year '); M = input(' enter month '); D = input(' enter day '); Payment_Date(i) = datetime(Y,M,D); t2=datetime(Y,M,D); dt=between(t2,Current_date); str=string(dt); c=sscanf(str,'%dM'); b=7; if c b Salary_Delayed(i) = input( ' Enter False : ', 's'); end end M = table(Employee_id,Name,Salary_Amount,Payment_Date,Salary_Delayed) Y =input(' Do you wish to contine , enter y = Yes , n = No', 's') end
Part B: Wage Protection System (WPS) In this part, you are required to implement the required report for WPS using functions. WPS is a UAE Central Bank platform to ensure that all companies are paying salaries for their employees. It is built to keep track of all the employee salaries and generate a CSV file of the records to be sent to Central Bank. This CSV file is generated on 10th of every Month. The functionalities that need to be implemented in WPS are as given below: - The user should be able to see the Welcome screen with the options/functions given below. Once any option is selected, user will be given a choice to go back to Welcome Screen where he can start again and select any option. The functions in WPS are (Implement each as a function in MATLAB): - 1. Add Details- This function enables user to add salary data such as EmployeeId, Name, SalaryAmount, PaymentDate (DD-MM-YYYY). a. Validation Check: Salary amount should not be less than 1000. If user enters salary amount less than 1000 then message displayed is "Salary amount is less than 1000. Please enter salary greater than 1000". b. Date format should be correct DD-MM-YYYY 2. Salary Delay: This function calculates if the salary was delayed, calculated by the difference in the Current Date and PaymentDate field: a. If salary payment date is within 7 days in the past, then salary delayed=TRUE IF Current Date 7 PaymentDate +7 THEN SalaryDelayed = False 3. Print Report: This function helps the user generate the CSV file that needs to be sent to Central Bank. The format of report is given below for current date (Suppose, Current Date is 24-10-2021) 4. Exit More requirements: - Validate the input of the user. If the user inputs the option which is not in the list, he should be prompted to input again. - Generate the CSV name as - "CentralBank_WPS.csvStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started