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 best describes rfid technology?
Liula [17]
RFID stands for <span>Radio-Frequency Identification. RFID is the use of radio waves to reach and capture data. The RFID chip can hold about 2,000 bytes of info.
</span><span>The RFID device serves the same purpose as a bar code or a magnetic strip on the back of a credit card or ATM card; it provides a unique identifier for that object. And, just as a bar code or magnetic strip must be scanned to get the information, the RFID device must be scanned to retrieve the identifying information.</span>
4 0
3 years ago
How to make a sad face on keyboard using alt?
forsale [732]
Literally just do a colon and parenthesis :(

:( :-(
8 0
3 years ago
Read 2 more answers
Difference between customized and packaged software​
docker41 [41]

Packaged software is a compilation of programs which are grouped together in order to provide publicly with different tools in the same group.

Custom software is a specific program that are advanced for a goal in a department or in a company.

5 0
2 years ago
"Different links can transmit data at different rates, with the _______ of a link measured in bits/second"
murzikaleks [220]

Answer: Transmission rate

Explanation:

 Transmission rate is measured in bits per second and it transmitted the data at the different rate across the circuit. The speed in which the data rate is transferred from one device to anther is known as transmission rate.

The transmission rate are always less as compared to signalling rate because the signalling rate contain the total data which basically include the overhead to control the information.

Therefore, transmission rate is the correct option.

 

7 0
3 years ago
¿Qué creo que debe considerar una empresa para elegir ellugar en el cual va a desarrollar su actividad económica osu emprendimie
zhannawk [14.2K]

Answer:

sorry I don't speak that language

8 0
2 years ago
Other questions:
  • Consider the following class definitions. public class BClass { private int x; public void set(int a) { x = a; } public void pri
    11·1 answer
  • Reggie has hired you to design a home network. The home network will share a printer but will mainly be used to stream movies to
    7·1 answer
  • How should you decide what to wear to an interview? What kind of things should be considered?
    12·1 answer
  • A computer has 9850 processes and 172 of them where suspended while 276 were terminated.,explain why some of the processes where
    15·1 answer
  • Enum Digits {0, 1};
    10·1 answer
  • Taking a group of recipes and identifying the similarities is an example of _____.
    13·1 answer
  • O Why was the Internet originally constructed? Oto enable researchers to communicate
    6·2 answers
  • Difference between private and confidential data?​
    5·1 answer
  • An international fast-food chain is looking for opportunities to leverage the Cloud to gain insights into customer data, includi
    10·1 answer
  • Guidewords for the word “serpent” may be
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!