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
fenix001 [56]
3 years ago
11

Use the Date object and the Array object to determine and diplay information about the current date on your webpage. Your output

should look like the following (adjusted for the current date):
Computers and Technology
1 answer:
Mnenie [13.5K]3 years ago
6 0

Answer:

  1. var today = new Date();
  2. var dateComp = [];
  3. dateComp[0] = today.getDate();
  4. dateComp[1] = today.getMonth();
  5. dateComp[2] = today.getFullYear();
  6. switch(dateComp[1]){
  7.    case 0:
  8.        console.log("Jan " + dateComp[0] + "," + dateComp[2])
  9.        break;
  10.    case 1:
  11.        console.log("Feb " + dateComp[0] + "," + dateComp[2])
  12.        break;
  13.    case 2:
  14.        console.log("Mar " + dateComp[0] + "," + dateComp[2])
  15.        break;
  16.    case 3:
  17.        console.log("Apr " + dateComp[0] + "," + dateComp[2])
  18.        break;
  19.    case 4:
  20.        console.log("May " + dateComp[0] + "," + dateComp[2])
  21.        break;
  22.    case 5:
  23.        console.log("Jun " + dateComp[0] + "," + dateComp[2])
  24.        break;
  25.    case 6:
  26.        console.log("Jul " + dateComp[0] + "," + dateComp[2])
  27.        break;
  28.    case 7:
  29.        console.log("Aug " + dateComp[0] + "," + dateComp[2])
  30.        break;
  31.    case 8:
  32.        console.log("Sept " + dateComp[0] + "," + dateComp[2])
  33.        break;
  34.    case 9:
  35.        console.log("Oct " + dateComp[0] + "," + dateComp[2])
  36.        break;
  37.    case 10:
  38.        console.log("Nov " + dateComp[0] + "," + dateComp[2])
  39.        break;
  40.    case 11:
  41.        console.log("Dec " + dateComp[0] + "," + dateComp[2])
  42.        break;
  43. }

Explanation:

The solution code is written in JavaScript.

Firstly, create a Date object (Line 1). The date object will automatically capture the current date and time.

Next create an array dateComp to hold the day, month and year (Line 3 -5). We use the getDate method to get current day, getMonth method for current month and getFullYear method for current year.

This is important to note that the getMonth method will return the value range from 0 - 11 with the Jan is represented as 0, Feb is 1 and so forth. Presume we intend to display the date using the format "month day, year", we can create a switch structure to check the month value which is range from 0 to 11. If month value is 0, generate string Jan + current day + "," + current year. We generate the date string based on different switch cases (7 - 44). We shall see the output similar to the date string as shown below:

Apr 12,2020

You might be interested in
What does the domain in an email message mean?
Zina [86]
The correct answer to this question is letter "C. type of service provider."

Here are the following choices:
<span>A. subject matter of the message.
B. type of software being used.
C. type of service provider.
D. location of the destination</span>
8 0
3 years ago
Grid computing is a type of computing in which:
fredd [130]

Answer:

b

Explanation:

A computing grid can be thought of as a distributed system with non-interactive workloads that involve many files.

7 0
2 years ago
Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and the minimum value to minMile
lina2011 [118]

Answer: 40, 4

Explanation:

8 0
2 years ago
Using the find and replace tool would be most appropriate when
mafiozo [28]

A. Changing the company name when the same letter is sent to different companies

The find and replace tool is meant to help replace all instances of a certain piece of text with a different piece of text.

For example, if a letter was sent to Company A, the find and replace tool could change every time the letter says “Company A” and make it say “Company B” instead so the same letter could be sent to Company B.

3 0
3 years ago
Read 2 more answers
To find out where a particular command is taken from, you can use the _____________ command.
nikklg [1K]

Answer:

type

Explanation:

7 0
3 years ago
Other questions:
  • The HR department of a company wants to send out an email informing its employees about an upcoming social event. Which email ap
    11·2 answers
  • Select the focus questions that emphasizes what is more important: (Select all that apply) a.What needs to be relegated to the b
    8·1 answer
  • What would you recommend for data segregation if using cloud software
    12·2 answers
  • I love dog my is 16 weeks old how old is yours
    12·1 answer
  • Can you awnser this question
    15·1 answer
  • How are search results organized?
    6·1 answer
  • The _________ operator returns the distance in bytes, of a label from the beginning of its enclosing segment, added to the segme
    9·1 answer
  • Most of the internal operations in a computer use hexagonal numbering true or false
    13·1 answer
  • What type of software repairs or improves a larger application that is already installed on a system?
    9·2 answers
  • __________, a level beyond vulnerability testing, is a set of security tests and evaluations that simulate attacks by a maliciou
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!