25. Is the following code correct as a data validation check? If not, how would you correct? (3) 1 if (month < 1 || mont

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

25. Is the following code correct as a data validation check? If not, how would you correct? (3) 1 if (month < 1 || mont

Post by answerhappygod »

25 Is The Following Code Correct As A Data Validation Check If Not How Would You Correct 3 1 If Month 1 Mont 1
25 Is The Following Code Correct As A Data Validation Check If Not How Would You Correct 3 1 If Month 1 Mont 1 (24.68 KiB) Viewed 34 times
25. Is the following code correct as a data validation check? If not, how would you correct? (3) 1 if (month < 1 || month > 12) fprintf('Error-invalid month'); else % Check to see if day is valid switch (month) case {1,3,5,7,8,10,12} max day = 31; fprintf('case 1-10'); case {4,6,9,11) max day = 30; fprintf('case 4-11'); case 2 max day = 28 + leap day; fprintf('case 2'); end
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply