Write a program that would determine the day number in a non-leap year. For example, in a non-leap year, the day number for Dec 31 is 365; for Jan 1 is 1, and for February 1 is 32. This program will ask the user to input day and month values. Then it will display the day number day number corresponding to the day and month values entered assuming a non-leap year. (See part II to this exercise below).

Answers

Answer 1

Answer:

In Python:

months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]

daymonths = [31,28,31,30,31,30,31,31,30,31,30,31]

day = int(input("Day: "))

month = input("Month: ")

ind = months.index(month)

   

numday = 0

for i in range(ind):

   numday+=daymonths[i]

numday+=day

print(numday)    

Explanation:

This initializes the months to a list

months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]

This initializes the corresponding days of each month to a list

daymonths = [31,28,31,30,31,30,31,31,30,31,30,31]

This gets the day from the user

day = int(input("Day: "))

This gets the month from the user

month = input("Month: ")

This gets the index of the month entered by the user

ind = months.index(month)

This initializes the sum of days to 0

numday = 0

This adds up the days of the months before the month entered by the user

for i in range(ind):

   numday+=daymonths[i]

This adds the day number to the sum of the months

numday+=day

This prints  the required number of days

print(numday)    

Note that: Error checking is not done in this program


Related Questions

The computer scientists Richard Conway and David Gries once wrote: The absence of error messages during translation of a computer program is only a necessary and not a sufficient condition for reasonable [program] correctness. Rewrite this statement without using the words necessary or sufficient.

Answers

Answer:

A computer program is not reasonably correct if it has no error messages during translation.

 

Explanation:

First, we need to understand what the statement means, and we also need to identify the keywords.

The statement means that, when a program does not show up error during translation; this does not mean that the program is correct

Having said that:

We can replace some keywords as follows:

absence of error messages := no error messages

Can i get any information on this website i'd like to know what its for ?
https://www.torsearch.org/

Answers

Explanation: torsearch.org is a safe search engine mainly used for dark wed purposes. It does not track your location nor give any personal information.

Give me good answers

1- what is the money?

2- what is the wealth?

How can it be used for good

Answers

Answer:

Money is currency

Explanation:

Is is how you pay for items

Your co-worker who went to UCLA tells you that DHCP is not enabled at your new job, so you should just use the same IP address that you have at home to connect to the internet. He told you it should work because your computer is communicating with a unique public IP address at home, so no other computer in the world would have it. When you try this, your computer does not have internet access. Give two reasons why?

Answers

Answer:

1. internet connection is not enabled on the computer.

2. The DHCP server in the company is not enabled as well.

Explanation:

For a user to access the internet, the computer must have a public IP address that is either assigned to it by a service provider or dynamically from the DHCP server in the computer. In the case of the former, the user just needs to enable the internet connection to obtain the unique IP address.

If the DHCP server or the internet connection is not enabled, the user would not have access to the internet.

What is Mobile Edge Computing? Explain in tagalog.​

Answers

Answer:

English: Multi-access edge computing, formerly mobile edge computing, is an ETSI-defined network architecture concept that enables cloud computing capabilities and an IT service environment at the edge of the cellular network and, more in general at the edge of any network.

Very very rough Tagalog: Ang multi-access edge computing, dating mobile edge computing, ay isang konsepto ng network architecture na tinukoy ng ETSI na nagbibigay-daan sa mga kakayahan sa cloud computing at isang IT service environment sa gilid ng cellular network at, higit sa pangkalahatan sa gilid ng anumang network.

Explanation:

What is your favorite LEGO set

Answers

Answer:

star wars death star....

i like any of them they are all so cool lol

Fyroff consultants, a leading software consulting firm in the United States, decides to launch an Enterprise Resource Planning (ERP) solution. The company chooses the brand name Fyroff Enterprise for the new solution. However, when the company attempts to register the domain name, it finds that a small unknown firm is already registered under the same domain name. The small firm is now attempting to sell the domain name to Fyroff. Which of the following terms refers to this practice of buying a domain name only to sell it for big bucks?
a. cybersquatting
b. logic bombing
c. cyberbullying
d. bot herding
e. cyberstalking

Answers

Answer:

The correct answer is a. cybersquatting

Explanation:

Cybersquatting is the registration of a domain name that corresponds to the denomination of a brand or name, with the main objective of obtaining some economic benefit from its sale to the owner and legitimate owner of the brand. Cybersquatting can range from making money by parking domains (buying names that are then "parked", that is, left unused but generating advertising revenue based on the visits they receive) to redirecting users to another website In order for it to get more traffic, that is, with cybersquatting it is generally intended to sell the registered domain names to the legitimate owners or interested parties, at a price well above the cost of registration or also to use the domain taking advantage of the recognition associated with the legitimate owner to obtain commercial advantages, as clients in the network.

When machining rotors, what is the reason for setting the indexing collars to zero?

A. To know how much metal was taken off of each side.

B. To make sure that no cut exceeds .010 inch

C. To determine the proper cut speed of the Brake Lathe.

D. To measure the depth of the grooves on the rotor surface.

Answers

Answer:

To determine the proper cut speed of the brake lathe

To determine the proper cut speed of the brake lathe reason for setting the indexing collars to zero.

What is indexing collars?

Thus, they can have a maximum of 256 colors, which is the amount of colors that 8 bits of information can specify (28 = 256). Fewer colors are produced by lower bit depths, which also result in smaller files. At the conclusion of this chapter, in Section 19.8, this is covered.

"Indexed color" refers to the fact that a color table contains the palette—the collection of colors—of the image. A reference (or "index") to a table cell containing the pixel's color is present in each pixel of the image.

By choosing Image Mode Color Table in Photoshop, you can view the table for an indexed color image.

Therefore, To determine the proper cut speed of the brake lathe reason for setting the indexing collars to zero.

To learn more about indexing collars, refer to the link:

https://brainly.com/question/12608731

#SPJ2

Which option should Curt use to share his calendar with other users inside his organization?
O Email Calendar
O Share Calendar
O Publish Online
O Share Online

Answers

Answer:

Share calendar

Explanation:

Because you will be able to limit certain permissions to the organization rather than emailing it.

also, edge unit test 2022

Curt should use to share his calendar with other users inside his organization  "Share Calendar"

What is calendar ?

A calendar is a method of structuring and displaying time, typically for the purpose of planning and scheduling events or activities. It typically shows dates, days of the week, and yearly months and enables people to keep track of events like meetings, appointments, birthdays, and holidays. A desk calendar, a physical wall calendar, or an electronic calendar stored on a computer, smartphone, or other device are all examples of calendars

The correct option for Curt to share his calendar with other users inside his organization is "Share Calendar".

To know more about calendar check:

https://brainly.com/question/17524242

#SPJ6

What is a key consideration when evaluating platforms?

Answers

Answer:

The continuous performance of reliability data integrity will lead to the benefit and profit of the platform's regular structure changes. Cleanliness in the platform whereas addresses the straightforward structure of task performance and adequate data integrity.

Which of the following statements is false?


Copyright exists the moment a work is created.


Copyright protects intellectual property such as text, art, film, music, or software.


Omitting the © copyright symbol means your work is not copyrighted.


Copyright is free.


You are not required to register your copyright.

Answers

Everything is false except the third one :)

It is false that omitting the © copyright symbol means your work is not copyrighted. The correct option is C.

What is a copyright?

Original works of authorship are protected by copyright, a type of intellectual property, as soon as the author fixes the work in a tangible form of expression.

The creators of the works of expression typically control the copyrights, however there are some significant exceptions: When an employee produces a work while employed, the employer is the rightful owner of the copyright.

Some individuals think that a work isn't covered by copyright law if it doesn't display a copyright emblem. That is untrue. The copyright symbol need not be used in most situations.

Thus, the correct option is C.

For more details regarding a copyright, visit:

https://brainly.com/question/14704862

#SPJ2

Def locate_substring(dna_snippet, dna): This function takes in two strings, dna_snippet and dna, where dna_snippet is a substring of dna, and returns all locations of the substring as a list of integers. In other words, dna_snippet may exist in multiple locations within dna; you should return the beginning index position of each occurrence of dna_snippet inside of dna. Example: * Sample DNA snippet (substring): "ATAT" * Sample DNA string: "GATATATGCATATACTT" * The returned position list: [1, 3, 9]

Answers

Answer:

In Python. The function is as follows:

def locate_substring(dna_snippet, dna):

   res = [i for i in range(len(dna_snippet)) if dna_snippet.startswith(dna, i)]  

   print("The returned position list : " + str(res))

Explanation:

This iterates defines the function

def locate_substring(dna_snippet, dna):

Check for all occurrence

   res = [i for i in range(len(dna_snippet)) if dna_snippet.startswith(dna, i)]  

print all occrrence

   print("The returned all position list : " + str(res))

Following is the Python program to the given question.

Python

According to the question,

DNA Series: GATATATGCATATACTTDNA

Snippet: ATAT

Program: def locate_substring (dna_snippet, dna):

start = 0 while True: start = dna.

find(dna_snippet, start) #finding the first occurrence of dna_snippet in dna.

if start == -1: return # if dna.find() returns -1 yield start #Resumes next execution start += 1dna=input ("Enter the DNA sequence: ") dna_snippet=input

("Enter the DNA snippet: ") print(list(locate_substring(dna_snippet,dna )))

Program Explanation: Defining a function.

An infinite loop is being utilized just to produce the indexes from which dna snippet begins.

Determining the initial occurrence of dna snippet inside dna. storing the new occurrences of dna snippet throughout the starting point.

Whenever dna.find() returns minus one, it means there was no occurrence identified and the method should be exited.

Find out more information about Python here:

https://brainly.com/question/26497128

Which statement about the Weather Bar in the Outlook calendar is true?

A.It displays weather for the current location for five days.
B.It does not require an internet connection to update.
C.Additional cities can be added for travel needs.
D.It sends pop-up alerts about severe weather.

Answers

Answer:

C

Explanation:

Which option in a Task element within Outlook indicates that the task is scheduled and will be completed on a later
date?
O Waiting on someone else
O In Progress
O Not started
O Deferred

Answers

I think it’s in progress

Answer: D: Deferred

Explanation:

took test

Select the true statement about network protocols.A protocol determines how the sending computer notifies the receiving computer about the presence of compressed data.A protocol determines how it will be executed on every networked device.A protocol determines how the sending device notifies the receiving device that there is data to be sent.A protocol is not required for all data transmissions.

Answers

Answer:

A protocol determines how the sending device notifies the receiving device that there is data to be sent.

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

A protocol can be defined as a standard set of rules established by the regulatory agencies to determine how data are transmitted from one network device to another.

Generally, the standard Internet communications protocols which allow digital computers to transfer (prepare and forward) data over long distances is the TCP/IP suite.

A protocol determines how the sending device notifies the receiving device that there is data to be sent, regardless of any difference in terms of structure or design.

please help me faster plzzz
correct plzz​

Answers

Answer:

a. A numeric keypad.

b. An interpreter.

c. A 3D printer.

d. A speaker.

Explanation:

An output device can be defined as a hardware device that typically receives processed data from the central processing unit (CPU) and converts these data into information that can be used by the end user of a computer system.

Also, an input device can be defined as any device that is typically used for sending data to a computer system.

Generally, all of the output and input device of a computer are known as peripheral (external) devices and they provide data (informations) to the end users in various formats such as video, audio, texts, images etc.

Since output and input devices are peripheral (external) devices, they can be connected to the computer system wirelessly or through a wired-connection (cable).

Some examples of peripheral (external) devices are monitor, speakers, keyboard, printer, mouse, scanner, projector etc.

Basically, the three (3) key element of a computer system are: a set of memory modules, processor and a set of input-output (I/O) modules. Each of the input-output (I/O) module interfaces to the central switch or system bus and are used to control one or more peripheral (external) devices.

a. A numeric keypad is a device used to input a PIN. It comprises of numbers ranging from 0 to 9.

b. An interpreter analyses and executes a program line by line.

c. A 3D printer produces output in the form of solid objects. It is typically used for inscribing or printing textual informations or graphic images on an object in three dimensions.

d. A speaker produces output in the form of sound. It is an electronic device that converts electrical signals into sound energy (waves).

((PLEASE HELP ME)) i need to get all my school work done before thursday
------------- are used to navigate between pages and Web sites.

Question 1 options:

Transitions


Animations


Hyperlinks


None of the above

Answers

Answer:

none of the above

Explanation:

Web navigation refers to the process of navigating a network of information resources in the World Wide Web, which is organized as hypertext or hypermedia. The user interface that is used to do so is called a web browser.

what is memory? explain types of memory?​

Answers

Memory is the electronic holding place for the instructions and data a computer needs to reach quickly. It's where information is stored for immediate use. Memory is one of the basic functions of a computer, because without it, a computer would not be able to function properly. Memory is also used by a computer's operating system, hardware and software.

Answer:

Memory is the taking personal record of computer of past experience. The types of memory are 1)Read Only Memory 2)Random Access memory

For her homework, Annie has added the picture of a fruit in a document. She wants to enhance it to give a cut-out look. Which feature or menu option should she use?

Answers

Answer: See explanation

Explanation:

Since we are given the information that Annie added the picture of a fruit in a document and wants to enhance it to give a cut-out, she can enhance her document's look by using clip art.

Clips art are simply used for designing and can be used in the illustration of a medium. In this case, the clip art can like a bitmap graphics which typically have a limited quality.

Answer:

Shapes

Explanation:

took the quiz

hy plzz help me friends​

Answers

Answer:

Ok so RAM is Random-Access-Memory.

RAM can store data just like in a hard drive - hdd or solid state drive - ssd

but the thing is that ram is really fast and data is only stored when RAM chips get power. On power loss your all data will be lost too.

ROM thanslates to Read-Only-Memory - so data in ROM chips can't be modifyed computer can just read the data but not write.

Read-only memory is useful for storing software that is rarely changed during the life of the system, also known as firmware.

Have a great day.

Explanation:

Answer:

Ram which stands for random access memory, and Rom which stands for read only memory are both present in your computer. Ram is volatile memory that temporarily stores the files you are working on. Rom is non-volatile memory that permanently stores instructions for your computer

Is there an alternative website of https://phantomtutors.com/ to get guidance in online classes?

Answers

Answer:

The website is

classroom

Explanation:

What is the New York Times doing to try to keep up with digital technology?

Answers

Answer:

Clover Food Labs: Using Technology to Bring The “Real Food” Movement to Cambridge, ... The New York Times is one of the many companies that has had its existence ... That monthly limit has since been reduced to 10 articles in an attempt to ... which has at least kept pace with the limited expectations for the industry

List 3 clinical tools available in the EHR and discuss how those benefit the patient and/or the practice

Answers

Thor Odin and Aries the threes listed powerful

please answer soon
Anonymity allows you to have freedom of
the internet
downloads
expression
information

Answers

Answer: Internet, I’m pretty sure about my answer.

Explanation: Anonymous communications have an important place in our political and social discourse.

Answer:

[ Freedom of expression ]

Why?

it was either that or internet but internet just means being able to use it rather than do whatever i guess

How many people has the largest cyber attack killed?

Answers

More that 1,000,000,000

Answer:

I think it's MyDoom?? I heard it's the most dangerous cyber attack in history since it caused 38 billion dollars.

Assume a future where security counter measures against DoS attacks are much more widely implemented than at present. In this future network, anti-spoofing and directed broadcast filters are widely deployed. Also, the security of PCs and workstations is much greater, making the creation of botnets difficult. Do the administrators of server systems still have to be concerned about, and take further countermeasures against, DoS attacks? If so, what types of attacks can still occur, and what measures can be taken to reduce their impact? Explain in detail with valid diagram and example.

Answers

Answer:

yes administrators have to be concerned

Explanation:

It is necessary for countermeasures to be taken against DoS attacks

The types of attacks that can still occur are:

If the network connection get to be overloaded,  there could be flash crown of this computer system and fraudulent activities maybe initiated. By flash crowd  we mean that the there is a great deal of traffic on the system and this could cause the network connection to be destroyed.

To reduce the impact of this kind of attacks,

1. there should be enough or excess network bandwidth  and distributed servers should be replicated if there is a possibility that network could get to be overloaded.

2. restriction is more commonly done on sporting sites. Restriction brings about an increase in implementation cost.

3. The impact of this type of attack can be reduced by stopping unwanted traffic throught the implementation of filters

4. Use strong antivirus on computer sytems that are used to connect to the internet

See the lseek_example.c file. Modify the lseek_example.c, such that it reads from an input file (named "start.txt") and will print to an output file (named "end.txt") every (1+3*i)th character, starting from the 1st character in the input file. In other words, it will print the 1st character, then skip 2 characters and print the 4th one, then skip 2 characters and print the 7th one, and so on.
For instance, for input file:
ABCDEFGHIJKLM
It will output:
ADGJM
Iseek_example.c file contant:
// C program to read nth byte of a file and
// copy it to another file using lseek
#include
#include
#include
#include
void func(char arr[], int n)
{
// Open the file for READ only.
int f_read = open("start.txt", O_RDONLY);
// Open the file for WRITE and READ only.
int f_write = open("end.txt", O_WRONLY);
int count = 0;
while (read(f_read, arr, 1))
{
// to write the 1st byte of the input file in
// the output file
if (count < n)
{
// SEEK_CUR specifies that
// the offset provided is relative to the
// current file position
lseek (f_read, n, SEEK_CUR);
write (f_write, arr, 1);
count = n;
}
// After the nth byte (now taking the alternate
// nth byte)
else
{
count = (2*n);
lseek(f_read, count, SEEK_CUR);
write(f_write, arr, 1);
}
}
close(f_write);
close(f_read);
}
// Driver code
int main()
{
char arr[100];
int n;
n = 5;
// Calling for the function
func(arr, n);
return 0;
}

Answers

Answer:

See the lseek_example.c file. Modify the lseek_example.c, such that it reads from an input file (named "start.txt") and will print to an output file (named "end.txt") every (1+3*i)th character, starting from the 1st character in the input file. In other words, it will print the 1st character, then skip 2 characters and print the 4th one, then skip 2 characters and print the 7th one, and so on.

For instance, for input file:

ABCDEFGHIJKLM

It will output:

ADGJM

Iseek_example.c file contant:

// C program to read nth byte of a file and

// copy it to another file using lseek

#include

#include

#include

#include

void func(char arr[], int n)

{

// Open the file for READ only.

int f_read = open("start.txt", O_RDONLY);

// Open the file for WRITE and READ only.

int f_write = open("end.txt", O_WRONLY);

int count = 0;

while (read(f_read, arr, 1))

{

// to write the 1st byte of the input file in

// the output file

if (count < n)

{

// SEEK_CUR specifies that

// the offset provided is relative to the

// current file position

lseek (f_read, n, SEEK_CUR);

write (f_write, arr, 1);

count = n;

}

// After the nth byte (now taking the alternate

// nth byte)

else

{

count = (2*n);

lseek(f_read, count, SEEK_CUR);

write(f_write, arr, 1);

}

}

close(f_write);

close(f_read);

}

// Driver code

int main()

{

char arr[100];

int n;

n = 5;

// Calling for the function

func(arr, n);

return 0;

}

Explanation:

Very large storage system that protects data by constantly making backup copies of files moving across an organization's network is known as ...

Answers

Answer:

RAID is a data storage virtualization technology that combines multiple physical disk drive components into one or more logical units for the purposes of data redundancy, performance improvement, or both.

Explanation:

RAID is a data storage virtualization technology that combines multiple physical disk drive components into one or more logical units for the purposes of data redundancy, performance improvement, or both.

What is File system failure?

File system failure refers to disk-related errors that may be due to corrupt files,  disk integrity corruption, file execution policies, bad sectors, etc. These errors may prevent be causing users from accessing or opening files. The first line of defense against a file system failure is a well-defined set of proper system backup and file maintenance procedures.

These errors can be encountered in files such as images, documents, PDFs, movies, etc. In order to protect and provide defense against file system failure, it is important to manage proper backup and file maintenance procedures.

Therefore, RAID is a data storage virtualization technology that combines multiple physical disk drive components into one or more logical units for the purposes of data redundancy, performance improvement, or both.

You can learn more about file system at:

brainly.com/question/14312784

#SPJ2

A video game character can face toward one of four directions: north, south, east, and west. Each direction is stored in memory as a sequence of four bits. A new version of the game is created in which the character can face toward one of eight directions, adding northwest, northeast, southwest, and southeast to the original four possibilities. Which of the following statements is true about how the eight directions must be stored in memory?
A. Four bits are not enough to store the eight directions. Five bits are needed for the new version of the game.
B. Four bits are enough to store the eight directions
C. Four bits are not enough to store the eight directions. Sodeen bits are needed for the new version of the game.
D. Four bits are not enough to store the eight directions. Eight bits are needed for the new version of the game.

Answers

Answer:

B. Four bits are enough to store the eight directions

Explanation:

The summary of the question is to determine whether 4 bits can store 8 directions or not.

To understand this question properly, the 8 bits will be seen as 8 different characters.

In computer memory, a computer of n bits can store 2^n characters.

In this case:

[tex]n = 4[/tex] i.e. 4 bits

So:

[tex]2^n = 2^4[/tex]

[tex]2^n = 16[/tex]

This implies that the memory can store up to 16 characters.

Because 16 > 8, then (b) answers the question.

Consider any tasks performed in real life, for example, driving a taxi. The task you pick involves many functions. Driving a taxi involves picking up customers, and quickly and safely transporting them to their destination. Go through the components of the AI cycle to automate the problem you choose. List the useful precepts available. Describe how you will represent your knowledge. Based on that, describe how you will use reasoning to make and execute a plan expected to achieve a goal or obtain maximum utility. (this is for artificial intelligence, but they did not have that option)​

Answers

The taxi came at night so you go
Other Questions
Gatsby Chapter 1What are the differences between the East Egg and West Egg? (IMPORTANT) Find two positive consecutive integers such that the square of the first added to three times the second is 24 Derek and his friend share two small pizzas Derek ate 7/6 of the pizzas which mixed number shows how much pizza Derek ate The state transportation commission counted cars traveling east and west across a toll bridge. The commission counted 20,000 cars traveling east and 30,000 cars traveling west. What percentage of the cars were traveling east? Write the equation of a line in slope-intercept form with a slope of 2 andpasses through the point (-3,1) Plz help will give brainliest! In what ways did the physical characteristics of Plymouth Plantation influence the economic activities of the Pilgrims? How many activities that leads to Global warming Which agency is directly related to supervising and managing campgroundsUs Forest ServiceBureau of land management Us fish and wildlife serviceNational park service if you can feel hot and cold in your hand but cannot tell if anyone is touching you hand, there may be a problem with the ____ in your hand How does Elie feel about suffering today? How does the desire to make alcohol illegal compare to current issues or events today? (vaping, smoking, etc.) Why was the migration to cities in the western United States a preferred choice for African Americans? describe the difference between a government's power and its authority. Then describe a situation in which a government's power and its authority. I need help ASAP wrong answers will be reported How many moles are in 297g of nh3?Please show work, will give brainliest. I need help with the question below:[tex]PCl_5 = PCl_3+Cl_2 \\ [/tex]Where PCl5 and PCl3 are gassesIn the above equation , Predict the effect of change in :I. Temperature ii. Pressureiii. Removal of Chlorine 8 folders cost $25.20. Write an equation to determine the cost of 3 folders. 8. A peacock weighs 152 ounces.How many pounds does the peacock weight? 9. Jessicas water bottle holds 0.75 liters of water.How many milliliters of water does the bottle hold? 10. Magnus found a moth and measured its wingspan. If the mothss wingspan was 27 millimeters, how many centimeters is the moths wingspan? Answer the question right dose DNA have cells i need to know for a assingment