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
Ksju [112]
2 years ago
10

Edhesive assignment 7 calendar

Computers and Technology
1 answer:
ikadub [295]2 years ago
5 0

Answer:

def leap_year(y):

 if y % 4 == 0:

     return 1

 else:

     return 0

def number_of_days(m,y):

 if m == 2:

     return 28 + leap_year(y)

 elif m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m ==10 or m == 12:

     return 31

 elif m == 4 or m == 6 or m == 9 or m == 11:

     return 30

def days(m,d):

 if m == 1:

     return 0 + d

 if m == 2:

     return 31 + d

 if m == 3:

     return 59 + d

 if m == 4:

     return 90 + d

 if m == 5:

     return 120 + d

 if m == 6:

     return 151 + d

 if m == 7:

     return 181 + d

 if m == 8:

     return 212 + d

 if m == 9:

     return 243 + d

 if m == 10:

     return 273 + d

 if m == 11:

     return 304 + d

 if m == 12:

     return 334 + d

def days_left(d,m,y):

 if days(m,d) <= 60:

     return 365 - days(m,d) + leap_year(y)

 else:

     return 365 - days(m,d)

print("Please enter a date")

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

month=int(input("Month: "))

year=int(input("Year: "))

choice=int(input("Menu:\n1) Calculate the number of days in the given month.\n2) Calculate the number of days left in the given year.\n"))

if choice == 1:

 print(number_of_days(month, year))

if choice == 2:

 print(days_left(day,month,year))

Explanation:

Hoped this helped

You might be interested in
Please do this now
Ber [7]

here are some ideas

some things i wished i knew before coming into middle school:

1. be organized

2. dont worry about other peoples opinions

3. DO YOUR HOMEWORK

things you learned so far:

1. a lot of things...

2. take notes

3.people change

advice:

if you stress too much, it gets hard.

its okay to get a bad grade on an assignment every once and a while.

be flexable with the people around you

TAKE DEEP BREATHS

DONT TALK DURING CLASS

going into the next grade:

i would change my dynamics and sleeping habits

so there are some ideas that i hope will help!!!

8 0
2 years ago
The CPU converts into information. The CPU is the mastermind of the computer, controlling everything that goes on through a seri
Harman [31]

Answer:

Mathematical sequences

Explanation:

Just did it

5 0
3 years ago
Read 2 more answers
Using the XML Document below (library with books), define the following queries in XQuery: (a) Give the titles of all Books sort
Softa [21]

Answer:

Explanation:

a)use order by clause for sorting

for $x in doc("books.xml")/bib/book order by xs:float($x/price) return $x/title (default sorted in ascending order)

or

for $x in doc("books.xml")/bib/book order by xs:float($b/price) descending  return $b/title (sorted in descending order)

b)doc("books.xml")//book[author = 'Abiteboul']

c)for $x in distinct-values(doc("bib.xml")/bib/book/author)

return <res>

<name>{$x}</name>

<count>

 {count (doc("bib.xml")//book[exists(indexof(author,$x))]) }

</count>

<res>

3 0
3 years ago
Given an list of N integers, Insertion Sort will, for each element in the list starting from the second element: Compare the ele
Elena L [17]

Answer:

def insSort(arr):

ct=0;

for i in range(1, len(arr)):

key = arr[i]

j = i-1

while j >=0 and key < arr[j] :

arr[j+1] = arr[j]

j -= 1

ct=ct+1;

arr[j+1] = key

return arr,ct;

print(insSort([2,1]))

Output of the program is also attached.

8 0
3 years ago
Modern ssds use a technique called "____" to spread write operations around the storage medium, thus evening out the impact of d
masha68 [24]

The question above has multiple choices as below;

<span>a.      </span>Wear aggregation.

<span>b.      </span>Wear mitigation.

<span>c.      </span>Wear prevention

<span>d.      </span>Wear leveling

The answer is d) Wear leveling.


This technique by some SSD controllers to increase the memory’s lifetime is called wear leveling. The mechanism for this principle is simple: distribute the entries for all the blocks evenly so that they will wear out evenly. Flash controller typically manages wear leveling and uses a wear leveling algorithm to control which physical block to use.







7 0
3 years ago
Other questions:
  • Wich of these is an example of magnetic storage
    11·1 answer
  • What is the difference between an electronic notebook and electronic flash cards?
    8·1 answer
  • In the formula "=A3/B3", what part of the formula is the "/"?<br><br> A)An operator<br> B)An operand
    5·2 answers
  • Blind spots are those areas not reflected in your:
    7·2 answers
  • Consider the code fragment below. Show the values stored at each location in memory and as they change while the code executes.
    5·1 answer
  • the tool that is used on the form to display text that the user cannot change is a. textbox b. label c. button​
    9·1 answer
  • What is the condition for setting an alarm clock
    11·1 answer
  • Write a program that inputs numbers and keeps a running sum. When the sum is greater than 100, output the sum as well as the cou
    13·1 answer
  • Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating-point number fo
    5·1 answer
  • allows users to enter text and control the computer with their voice.allows users to enter text and control the computer with th
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!