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
With an example in each, describe the use of two basic functions which are known by the "string.h" header file.
olga nikolaevna [1]

Answer:

strcmp(char * A, char * B);

strcat(char * A, char * B)

Explanation:

One of these basic functions is the function strcmp(char * A, char * B).

This functions compares if two strings are equal; If they are, it returns 0. If not, it returns 1;

So, an example:

char A[13] = "Buffalo Bills";

char B[13] = "Buffalo Bills";

if (strcmp(A,B) == 0)

printf("The strings are the same\n);

else

printf("The strings are not the same");

In this case, they are the same.

----------------------

If for example:

char B[13] = "Buffalo Billz"

It would fall in the else, A and B would not be the same strings.

--------------------------

Other function is the strcat(char * A, char * B);

This function takes two strings as an input, and concatenate them to the first.

For example:

char A[15] = "Buffalo";

char B[5] = "Bills";

strcat(A, B);

printf("%s\n", A);

The output is:

Buffalo Bills

5 0
3 years ago
Public class Bird
Anna007 [38]

Answer:

Answer below.

Explanation:

You are creating an object of bird "b" with a talon strength of 5 and a beak of 5.

public Hawk(int talon, int beak)

{

super(beak);

talonStrength = talon;

}

Please mark brainliest if this is the answer you were looking for

Please mark brainliest if this is the answer you were looking for

6 0
3 years ago
¿Por que windows es el sistema operativo más utilizado?
Hatshy [7]

Answer:

Explanation:

Hay muchas razones, para empezar Windows ha estado desde el año 1995. Tuvo muchas actualizaciones y Microsoft (la compañia que lo creo) los sigue actualizando y agregando nuevas funciones. Ademas de eso, Windows es compatible con casi todos los programas que salen. Esto le ayuda a que el usario pueda usar todos los programas que quiera y aumenta la popularidad del sistema operativo. Microsoft tambien trae pre-instalado Windows en todas sus computadoras personales que vende.

3 0
2 years ago
Set-In-Order includes making changes to the layout of the area.A) TrueB) False
Bogdan [553]

Answer:

A) True

Explanation:

Set-In-Order is part of a 5S system approach of making a workplace to be well arranged so there will be smooth operation of employees and working conditions.

Set-In-Order specifically deals with entities in the workplace apparently labeled after being well arranged in their respective places.

Hence, it is TRUE that Set-In-Order includes making changes to the layout of the area.

7 0
3 years ago
19) If you want to find your lowest paid, full time employee (with "FT" in column B and each employee's salary found in column C
Vadim26 [7]

Answer:

MAXIF

Explanation:

The MAXIF function is a function used in Ms Excel.

  • This function indicates the maximum value located on an array .

Option B

7 0
2 years ago
Read 2 more answers
Other questions:
  • Once you select select a crop boundary, you can no
    15·1 answer
  • a corporation needs an operating system that allows the various teams in its office to network & collaborate on projects. wh
    11·2 answers
  • A digital media professional's computer is too full of video files. She would like to upgrade her computer to have more capacity
    12·2 answers
  • Keyboards that are widely used on various smartphones and other small portable devices, and which are designed primarily for com
    15·1 answer
  • A company has two geographically separate locations that need to connect using a VPN. Which of the following devices must be spe
    7·1 answer
  • Information management should supply information in the form of meaningful images rather than raw data, which requires that we h
    13·1 answer
  • What symbol do we use to denote a character?
    14·1 answer
  • Choose the missing words in the code below.
    12·1 answer
  • Which statement about broadcasting a slideshow online is true?
    14·2 answers
  • What information is necessary to review in order to be considered familiar with the Safety Data Sheet (SDS) of a substance
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!