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
Varvara68 [4.7K]
2 years ago
9

Write a program that prompts the user to enter a date, using integer values for the month, day, and year, and then prints out th

e day of the week that fell on that date. According to the Gregorian Calendar, January 1, 1601 was a Monday. Observe all leap years (and keep in mind that 1700, 1800, and 1900 were not leap years).
Computers and Technology
1 answer:
attashe74 [19]2 years ago
5 0

Answer:

import datetime

user = input("Enter date in yyyy,m,d: ").split(",")

int_date = tuple([int(x) for x in user])

year, month, day =int_date

mydate = datetime.datetime(year, month, day)

print(mydate)

x = mydate.strftime("%B %d, %Y was a %A")

print(x)

Explanation:

The datetime python module is used to create date and time objects which makes it easy working with date-time values. The user input is converted to a tuple of integer items, then they are converted to date time objects and parsed to string with the strftime method.

You might be interested in
Write a function named replaceSubstring. The function should accept three C-string arguments, let's call them string1, string2,
hoa [83]

Answer:

All is in explanation.

Explanation:

#include <iostream>

#include <cstring>

#include <string>

using namespace std;

//function prototype

string replaceSubstring(const char *, const char *, const char*);

string replaceSubstring(string, string, string);

int main()

{

//declare three char array to hold strings of max 100 chars

char string1[101];

char string2[101];

char string3[101];

//prompt user to enter input

//then read

cout << "Enter string to search:\n";

cin.getline(string1, 101);

cout << "Enter the string you want to replace:\n";

cin.getline(string2, 101);

cout << "What do you want to replace it with?\n";

cin.getline(string3, 101);

cout << "Your updated string is:\n";

cout << replaceSubstring(string1, string2, string3);

//return 0 to mark successful termination

return 0;

}

string replaceSubstring(const char *st1, const char *st2, const char *st3){

//declare pointers start and occurrence

//initialize start with string to search

//char *startSearch = st1;

//initialize occurrence with the first occurrence

//of st2 in st1

char *occurrence = strstr(st1, st2);

//declare empty string

string output = "";

//using occurrence as control for while loop

//means that it will iterate until no more

//occurrences are found

while(occurrence){

//append to final string the characters of st1

//up until first occurrence of st2

output.append(st1, (occurrence-st1));

//append st3 to final string

output.append(st3, strlen(st3));

//update occurrence to point to character

//of st1 just after first occurrence of st2

st1 = st1 + (occurrence-st1) + strlen(st2);

//find new occurrence

occurrence = strstr(st1, st2);

}

//st1 now points to first character after

//last occurrence of st2

output.append(st1, strlen(st1));

return output;

}

string replaceSubstring(string st1, string st2, string st3){

//convert input strings to C-strings

const char *ptr1 = st1.c_str();

const char *ptr2 = st2.c_str();

const char *ptr3 = st3.c_str();

//call function that accepts C-strings

replaceSubstring(ptr1, ptr2, ptr3);

}

6 0
2 years ago
Read 2 more answers
Give the an example of the following .<br>a.)typing software<br>​
IceJOKER [234]
Max Type Pro

Stamina Typing Tutor.
3 0
2 years ago
Read 2 more answers
Question 5 of 10
Drupady [299]
The programs you need for you are not even done yet
3 0
1 year ago
(a) If host 192.168.0.1 sends out a packet with source IP address 192.168.0.1 and source port number 3345, after the packets lea
Evgen [1.6K]

Question: The question is incomplete. See the complete question below;

Consider the following situation using NAT (Network Address Translation), where the router uses one public IP address, 138.76.29.7, for several hosts with private IP addresses. The NAT table already has the information as shown due to previous communications.

Answer:

Source IP = 208.38.69.1

Source port = 3006

Explanation:

Network Address Translation (NAT) simply means  the translation of one or more local IP address so as to provide internet access to local hosts. In this case, the router uses one public IP address and with private IP address.

8 0
3 years ago
Read the following scenario:
Zigmanuir [339]
The answer would be option C "The app company will sue the multimedia artist for breach of contract." The company bought the game therefore it's no longer his and the multimedia artist cannot release the original version because the app is no longer his and he will be sued for breach of contract. Because if the popular company bought the app from the <span>multimedia artist they would have to sign a contract and other paper work to confirm their purchase.

Hope this help!
</span>
7 0
3 years ago
Other questions:
  • You are reluctant to write an extra credit book report because you are afraid that your language and punctuation skills are not
    11·1 answer
  • The first step in creating photographs with good backgrounds is which of the following? Learning to see the background before ta
    11·2 answers
  • Select the correct answer.
    9·1 answer
  • 30
    5·1 answer
  • The while loop is a pre-test loop? TRUE OR FALSE
    9·2 answers
  • ) What is the ""Phantom Inspector""? (
    12·1 answer
  • Using more than one array to store related data is called _____________ arrays.
    7·2 answers
  • Guess The Song:
    9·1 answer
  • What are some ways you can give staying off your phone a "boost" and make it easier to do?
    9·1 answer
  • Juan wrote a loop to print all the prime numbers between 1 and 100. But instead of stopping at 100, it continues on and on forev
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!