1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Yuri [45]
3 years ago
14

Days of the week are represented as three-letter strings ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"). Write a javaScript f

unction solution that, given a string S representing the day of the week and an integer K (between 0 and 500), returns the day of the week that is K days later. For example, given S = "Wed" and K = 2, the function should return "Fri". Given S = "Sat" and K = 23, the function should return "Mon".
Computers and Technology
1 answer:
dmitriy555 [2]3 years ago
3 0

Answer:

function getDay(s, k){

var weekDays = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];

var index=weekDays.findIndex(function(weekDay){return weekDay==s;});

return weekDays[(index+k)%7];

}

Explanation:

//this functions receive the next parameters:

//s which is the day of the week

//k the number of days after s week day

function getDay(s, k){

var weekDays = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];

//variable index is the index in list weekDays of s

var index=weekDays.findIndex(function(weekDay){return weekDay==s;});

//use module operator % to get the remainder of the division (index+k)/7

//return the string value of the day

return weekDays[(index+k)%7];

}

You might be interested in
Is anyone really good at immerse 2 learn??
VARVARA [1.3K]

Answer:

I am, so... yes

Explanation:

3 0
3 years ago
Technologies have advanced to allow computer chips to be placed in almost anything and to be connected to a network almost anywh
Soloha48 [4]

Answer:

"Internet of thing" is the correct answer for the above question.

Explanation:

  • "Internet of thing" refers to the set or collection of machines and objects for communication. It is used to connect the object and machine in a network so that they are communicating. For example, the umbrella tells the temperature to the human.
  • The above question asked about the technology which has a mechanism to place the chips to the object and that object can communicate with the machine. This type of mechanism is known as the "Internet of thing". So the answer is "Internet of thing".
7 0
3 years ago
Gus has decided to organize his inbox on June 26 by using folders and deleting irrelevant messages. He creates a folder called "
Slav-nsk [51]

A. Schedule Update for Project XYZ

8 0
3 years ago
Read 2 more answers
The IPv6 address for an Ethernet connection begins with FE80::/64. What does this tell you about the address
Mnenie [13.5K]

Typically, link-local IPv6 addresses have “FE80” as the hexadecimal representation of the first 10 bits of the 128-bit IPv6 address, then the least-significant 64-bits of the address are the Interface Identifier (IID).

Yw and pls mark me as brainiest

6 0
3 years ago
Phân tích cạnh tranh của cocacola và pepsi
Fittoniya [83]
I don’t understand please speak English
7 0
2 years ago
Other questions:
  • Into which of these files would you paste copied information to create an integrated document?
    13·2 answers
  • Samantha plans an investigation in which she will study a population of animals. Which of these answers best describes the focus
    8·1 answer
  • I’m nobody. Who are you?
    9·2 answers
  • What is the quickest way to change the format of a table?
    8·1 answer
  • How do the principles behind the Agile Manifesto suggest approaching architecture?A. Architecture emergesB. Architecture is not
    10·1 answer
  • Help me I'm so confused by this question
    7·1 answer
  • How was WiFi discovered?
    8·1 answer
  • The terms Apps and Applications can be used interchangeably about software installed
    8·1 answer
  • You have a small business.Due to the recent pandemic you seem to be losing contacts with your suppliers and customers.You want t
    10·1 answer
  • 9. Lael wants to determine several totals and averages for active students. In cell Q8, enter a formula using the COUNTIF functi
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!