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
Naily [24]
2 years ago
5

Write a program that asks a user to enter a date in month day year format (for example 10 12 2016) and displays the day of the w

eek for that date, in this case, Wednesday.
Computers and Technology
1 answer:
AleksAgata [21]2 years ago
8 0

Answer and Explanation:

Using javascript:

function dayof_theweek(){

var TodayDate = window. prompt("enter today's date in the format 'year, month, day' ");

var Datenow=new date(TodayDate);

var Dayofweek=Datenow.getday();

var Days=["monday","Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];

if(Dayofweek==indexOf(Days[Dayofweek]))

{

document.createTextnode(Days[Dayofweek]);

}

}

The program above uses a date object which uses the method getday to get the day of the week(get day returns an integer from 0 to 6).we then use a comparison operator == to test the condition that returned value Dayoftheweek is same with the index of the array Days and then print to a html document. The program may need improvements such as the fact that errors may arise when proper input isn't given, and therefore must be handled.

You might be interested in
Which function in Spell Checker should Patrick use if he makes the same mistake frequently when typing emails?
Olin [163]

Answer:

Explanation:

Click Spelling and Grammar and choose AutoCorrect,

4 0
3 years ago
What is the purpose of the ISOWEEKNUM function?
Zarrin [17]
Answer is D
Stay safe !
3 0
2 years ago
Read 2 more answers
The most common size for a brochure is _____.
Juli2301 [7.4K]
3.5X2 cannot be the answer as it too small and not enough information can be put into it. The common size for tri-fold brochures is 8.5X11 or letter size even when 8.5X14 is also a size used it is not the most common size.
6 0
3 years ago
Match the definition with the correct term: Closeness to the true value of a measurement
LenKa [72]
Closeness to the true value of a measurement is accuracy
7 0
3 years ago
Which goal of design theory can be described as the proper distribution
muminat
The answer is balance
7 0
3 years ago
Other questions:
  • Jesse is writing a physics quiz about the motion of a roller coaster cart. He has a clip art illustration of a cart rolling hori
    9·2 answers
  • What is the synonym for term port?
    9·1 answer
  • A loop that repeats a specific number of times is known as a(n):
    9·1 answer
  • A small company is requesting a quote to refresh its wireless network. The company currently runs 60 autonomous APs and has plan
    13·1 answer
  • What is the encryption cipher that was the precursor to des??
    5·1 answer
  • Select the statement that best describes the function of the cell wall. O it gives shape to plants cells. O it produces food fro
    14·1 answer
  • Organizing speech ideas according to physical space, direction, or location calls for a _____ organizational pattern.
    11·1 answer
  • What type of code do computers typically use to operate? A. CSS B. HTML 5 C. HTML D. Binary
    12·2 answers
  • In what machines, places and apparatus are dimmers used in? Put at least 5 examples
    9·1 answer
  • Greg wants to check the amount of requests his website receives. What test can he use?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!