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
Which document would most likely be written in an informal style?
Masteriza [31]

Answer:

An advertisement for sportswear

Explanation:

An advertisement for sportswear would most likely be written in an informal style.

6 0
3 years ago
Instructions:Select the correct answer from each drop-down menu.
mario62 [17]

when using a dark background for presentations you should use bright colors to contrast with it


this makes the informations much easier to see and read for example white text on black background

6 0
2 years ago
Question #6
Vitek1552 [10]

Answer:

ValueError

Explanation:

Required

Determine the error the program returned

The above will return a ValueError error and the reason is as follows.

The first line of the program initializes variable as 'live'.

The next line tries to convert answer to integer and this is where it returns the error'.

On the second line, variable amount expects that the answer variable to contain number e.g. '567' but because it doesn't contain a complete number (i.e. unexpected values), the program returns a ValueError.

7 0
2 years ago
Read 2 more answers
An adjustable wrench's movable jaw is positioned <br> by​
ki77a [65]
Placing it on top then sliding the dile to close it, can you give me brainlist??
7 0
2 years ago
1. Write the name of the tab, command group, and icon that is used to sort information in a Word document.
mixer [17]

<u>Answer</u>:

<em>It is possible to sort data in word. For doing this, you must have content in the form of list. </em>

<u>Explanation:</u>

<em>1. Select the text in numbered list / bulleted list </em>

<em>2. Click on the Home tab, Paragraph group, Click on Sort. You well get a Sort Text dialog box</em>

<em>3. In the dialog box , Click Paragraph, Text, Ascending / descending. So you can change the way it sorted by using the same dialog box whenever required. </em>

<em> In addition to sorting text, you can  sort date and also sort number. </em>

7 0
3 years ago
Read 2 more answers
Other questions:
  • A ____ is a device that interconnects two or more workstations in a star-wired bus local area network and immediately retransmit
    9·1 answer
  • Mark works as a Network Administrator for NetTech Inc. The company has a Windows Server 2008 domain-based network. The network c
    7·1 answer
  • To close the ____ view, click File on the Ribbon or click the preview of the document in the Info gallery to return to the docum
    9·1 answer
  • You want to equip yourself with FRUs for a laptop. What would you take with you? (Choose two)A. RAMB. SD card readerC. Video car
    10·1 answer
  • Define get_date() function.
    6·1 answer
  • Which line of code will find the first occurrence of a three in an array?
    5·2 answers
  • PACIFIC NORTHWEST
    10·1 answer
  • TOT al<br>Name TWO examples of these settings and utilities. (2)​
    12·1 answer
  • List out the storage measurements units of a computer .<br><br>​
    10·2 answers
  • How to change the microsoft word pages to black background
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!