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
Your boss wants to utilize some sort of cloud storage for his files so that all of his
Valentin [98]

Well, if he's using Google Drive or OneDrive it shows up in the main menu so My best guess would be Local Profile

4 0
3 years ago
Read 2 more answers
Match each term to the appropriate definition. DBMS data mining hash file index key field locking protocol relation roll back sc
puteri [66]
The correct answer is e just took the test on edg
5 0
3 years ago
A nonprofit organization uses a contact management database to track donations, amounts donated, and all correspondence and phon
notka56 [123]

Answer:

nvbvbnvvbnbnvbnvbn

Explanation:

vbnvbnvbnbnnnbvnn

7 0
3 years ago
What should you include in a persuasive speech
Vlad [161]

Answer:

Come up with a controversial topic, one that make your listeners think

Research the topic thoroughly that you have chosen

Understand the perspective of your audience. Keep your goal in mind. You are trying to persuade the audience to do or believe something .

7 0
3 years ago
A report has a column of totals, with each total adding to the cell above it. What kind of calculated figure is this?
Alexxx [7]

ANSWER:

The correct answer is Running Sum.

Explanation:

A report has a column of totals, with each total adding to the cell above it. Such type of calculated figure is called the Running Sum.

Running sum is also called the Partial Sum. In such type of summation, the values in the sequence is added to get a final result and then if a new number comes, it is again added to the grand sum, and in this way the sequence continues. Every new entry is added to the previous sum to get another sum.

3 0
3 years ago
Other questions:
  • Davia draws a shape with 5 sides. two sides are each 5 inches long. two other sides are each 4 inches long. the perimeter of the
    15·1 answer
  • In three to five sentences, explain how you would insert graphics using your word-processing software.
    7·2 answers
  • What important information is needed if you are installing an oem version of windows 7?
    6·1 answer
  • PLEASE HELPPPPPPP
    15·1 answer
  • What is a telecomunications system? 1) A system that enables the transmission of data over public or private networks. 2) A comm
    11·1 answer
  • Is there a way to get back old messages that you didn't mean to delete??? I have a Samsung S5 and I really really need help. I d
    11·2 answers
  • PLEASE PLEASE PLEASE PLEASE PLEASE HELP! I'M BEGGING Y'ALL! I NEED THIS FOR TODAY! CORRECT ANSWERS WILL BE AWARDED BRAINLIEST!
    6·1 answer
  • س2) اکتب خوارزميه لحل المعادلة الرياضيه الاتيه
    9·1 answer
  • Under what scenarios can we clear the NVRAM by moving the PSWD jumper to the RTCRST<br> pins?
    8·1 answer
  • What is the value of six sigma ? How dose it relate to agile management
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!