gpt4 book ai didi

Write a function named WeekDay() making use of select case, the function will receive a single argument containing a STRING (days Monday - Sunday)(使用select case编写一个名为WeekDay()的函数,该函数将收到一个包含STRING的参数(days Monday-Sunday))

转载 作者:bug小助手 更新时间:2023-10-22 17:34:53 29 4
gpt4 key购买 nike



Use Scilab answer the following questions:
Paste both your function code, and console output demonstrating the features of the function.
Write a function named WeekDay() making use of select case, the function will receive a single argument containing a STRING (days Monday - Sunday) and print a corresponding number and return an integer which is the matching week day name based on the following pairing:
1 : Monday
2 : Tuesday
3 : Wednesday
4 : Thursday
5 : Friday
6 : Saturday
7: Sunday
The function will also give the same result regardless of case of the argument string (i.e. Monday, and Monday and MONDAY will all be treated equally).
Sample output:
--> WeekDay('Tuesday')
ans =
2

使用Scilab回答以下问题:粘贴函数代码和演示函数特性的控制台输出。利用select case编写一个名为WeekDay()的函数,函数将接收一个包含STRING(days Monday-Sunday)的参数,并打印相应的数字并返回一个整数,该整数是基于以下配对的匹配周-日名称:1:星期一2:星期二3:星期三4:星期四5:星期五6:星期六7:Sunday无论参数字符串大小写,函数也将给出相同的结果(即星期一、星期一和星期一将一视同仁)。示例输出:-->工作日('Tuesday')ans=2


I am unable to solve it

我无法解决


更多回答

Welcome to Stack Overflow! We won’t do your work for you. Copy/pasting your homework into the text area thinking someone will do it for you is not only cheating, but will hurt you in the long run, as you probably won’t perform well on future assignments/tests. Please take the tour and read How to Ask, then edit to include past attempts and a minimal reproducible example showing what you have completed so far. For more info, check out the open letter to students with homework problems and this Meta FAQ.

欢迎使用Stack Overflow!我们不会为你做你的工作。把你的作业复制/粘贴到文本区,以为有人会帮你做,这不仅是作弊,而且从长远来看会伤害你,因为你可能在未来的作业/测试中表现不佳。请参观并阅读“如何提问”,然后编辑以包括过去的尝试和一个可重复的最小示例,显示您迄今为止完成的内容。欲了解更多信息,请查看致有家庭作业问题的学生的公开信和此Meta常见问题解答。

优秀答案推荐

WeekDay() is a function it will accept one parameter as Date and it returns weekday value.

WeekDay()是一个函数,它将接受一个参数作为Date,并返回工作日值。


You can try something like this.
SELECT case WEEKDAY(NOW())
when 'Monday' then 1
when 'Tuesday' then 2
when 'Wednesday' then 3
when 'Thursday' then 4
when 'Friday' then 5
when 'Saturday' then 6
when 'Sunday' then
END

你可以试试这样的东西。选择案例WEEKDAY(NOW())当“星期一”时,然后1当“星期二”时,2当“星期三”时,3当“星期四”时,4当“星期五”时,5当“星期六”时,6当“星期日”时,结束


更多回答

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com