Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Test inputs Write a function called CheckInputs which checks if three inputs parameters are the correct data types. The first, second, and third input variables
Test inputs
Write a function called CheckInputs which checks if three inputs parameters are the correct data types. The first, second, and third input
variables must be a string, numeric, and logical data type, respectively. The output of Checkinputs should be a logical row array,
errorCode, with values.
If all the tests pass, then errorCode should consist of only false values. If the st input parameter is not a string, the st array element in
errorCode is set true. If the nd input parameter is not a numeric, the nd array element in errorCode is set true. If the rd input
parameter is not a logical variable, the rd array element in errorCode is set true. The th array element in errorCode is set true if three
input parameters are not present.
Ex:
name"Joe"; gpa; enrollStatustrue; All datatypes correct
errorCode CheckInputs name gpa, enrollStatus
errorCode
x logical array
name; gpa; enrollStatustrue; & First datatype incorrect
errorCode CheckInputs name gpa, enrollStatus
errorCode
x logical array
name"Joe"; gpa; enrollStatus Third datatype incorrect
errorCode CheckInputs name gpa, enrollStatus
enrollStatus
errorCode
x logical array
errorCode CheckInputs name gpa & Absent input argument
errorCode
x logical array
Step 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