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
Formatting. Given input that represents a floating point number, that is, made up of digits and at least one decimal point, conv
Ronch [10]

Answer:

s = input("Input a float: ")

print("{:12.2f}".format(float(s)))

Explanation:

  • Read a number  from user using the input function of Python.
  • Use the format function of Python to correctly format the output according to the given requirements.
  • Note: Use Python 3.6 or above for this code to run without any issue.

Output:

Input a float: 1234.56789

1234.57

3 0
3 years ago
Assume you have written a method with the header num mymethod(string name, string code). the method's type is
azamat
I need answer choices
5 0
3 years ago
Which of these statements regarding mobile games is true?
SashulF [63]

Answer:

A. They are typically played in doors.

Explanation:

Most logical answer

8 0
3 years ago
Read 2 more answers
A program that performs handy tasks, such as computer management functions or diagnostics is often called a/an ____________.
Elodia [21]

Answer:

DOS

Explanation:

Disk operating

4 0
2 years ago
You created an outline within a worksheet. what does the button indicate to the left of a row heading?
cricket20 [7]
<span>Business Name (default field), State (correct field)</span>
3 0
3 years ago
Other questions:
  • The exercise instructions here are long -- please read them all carefully. If you see an internal scrollbar to the right of thes
    15·1 answer
  • What information medium is used to access information from the Internet in the form of HTML pages?
    12·1 answer
  • Which steps allow a user to change the column layout in the Handout Master?
    9·1 answer
  • Which model allows you to make subsystems in parallel?
    12·1 answer
  • Who knows a website that can connect videos in your phone
    8·1 answer
  • Question 8 (True/False Worth 3 points)
    15·1 answer
  • Will give brainliest
    10·1 answer
  • explain why you can determine machine epsilon on a computer using IEEE double precision and the IEEE Rounding to Nearest Rule by
    7·1 answer
  • You are a software engineer at a company where management routinely encourages you and your colleagues to use pirated software.
    5·1 answer
  • Lab 8-1: Working with Boot Loader and Runlevels what is the root password
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!