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
taurus [48]
2 years ago
5

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).
Computers and Technology
1 answer:
SOVA2 [1]2 years ago
7 0

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

<em>for i in range(ind):</em>

<em>    numday+=daymonths[i]</em>

This adds the day number to the sum of the months

numday+=day

This prints  the required number of days

print(numday)    

<em>Note that: Error checking is not done in this program</em>

You might be interested in
What is the output of the following?
lys-0071 [83]

Answer: a. the number is: 14

Explanation:

i mean just try to write in 7 instead of x in the second line

then it would say the number is: ....

what is 7 times 2?

14

so the answer is a

5 0
2 years ago
Why are the READ and DATA statements used<br>together?​
3241004551 [841]

Explanation:

DATA statements are used in conjunction with READ statements. Together they assign numbers or strings to variable names.

4 0
3 years ago
Let C(x) be the statement "x has a cat," let D(x) be the statement "x has a dog," and let F(x) be the statement "x has a ferret.
allsm [11]

Answer:

See attached for answer and explanation

Explanation:

Note: the question is incomplete, consider the statements below as the statements to be expressed in terms of C(x), D(x), F(x), quantifiers, and logical connectives.

(a) A student in your class has a cat, a dog, and a ferret.

(b)  All students in your class have a cat, a dog, or a ferret.

(c) Some student in your class has a cat and a ferret, but not a dog.

(d) No student in your class has a cat, a dog, and a ferret.

(e) For each of the three animals, cats, dogs, and ferrets, there is a student in your class who has this animal as a pet.

7 0
3 years ago
SMART PEOPLE NEEDED
mario62 [17]
D doesn't make much sense, it's valid, but not what we're looking for. B also has a correlation with D, same reasoning applies. As for A, it seems pretty legit, but I don't believe that's what we're looking for.

Choice C is the most obvious one though. We're talking about a network and as may or may not know it's a wireless one in a manner of speaking. A <span>couple of computers in the network that have trouble maintaining a signal will indefinitely lead to failure of a network since both the links and nodes of certain computer systems are incapable of maintaining a signal. </span>
6 0
2 years ago
A negative effect of computer technology's role in creating images is that:
otez555 [7]

Answer:

Personally would go with D.

Information being shared could be both good and bad but it all would be about the situation and if it was private information or not.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Describe how using active listening at work can help you be a better employee.
    15·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    12·1 answer
  • How a computer encodes text, how it is processed and how computer data is represented.
    6·1 answer
  • __________________ ensures that each row is uniquely identified by the primary key, which means that a proper search for an exis
    10·1 answer
  • The default (preset slide layouts are set up in ____ orientation.
    15·1 answer
  • The fractional_part function divides the numerator by the denominator, and returns just the fractional part.
    10·1 answer
  • Your project will require a 7-day work week rather than the traditional 5-day. How can you adapt the software to this new schedu
    15·1 answer
  • Sustainable development is a goal towards which all human societies need to be moving. elaborate the statement in about 120 word
    9·1 answer
  • I need help so bad it’s the entire test for EdHesive python coding Test 2
    5·1 answer
  • Which of these would be the fastest transition duration?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!