Following are the program to the given question:
Program Explanation:
Defining three methods "leap_year, number_of_days, and days_left " is declared. In the "leap_year" method, it accepts the year variable, which calculates the year is the leap year and returns its value that is 1. In the next method "number_of_days", it is define which accepts the "year and month" variable in the parameter and calculate and returns its value. In the last "days_left" method, it calculates the left days and returns its value, and outside the method, two dictionary variable days_31 and days_30 is declared. It initilized a value by using 3 input variable "day, month, and year" variable which accepts user-input value. In the next step, a "c" variable is declared, that input values and calls and print its value accordingly.Program:
def leap_year(y):#defining a method leap_year that takes one parameter
l= 0#defining l variable that holds an integer
if y % 4 == 0:#using if block that check year value module by 4 equal to 0
l = 1#holding value in l variable
if y % 100 == 0:#using if block that check year value module by 100 equal to 0
l = 0#holding value in l variable
if y % 400 == 0:#using if block that check year value module by 400 equal to 0
l= 1#holding value in l variable
return l#return l value
def number_of_days(m, y):#defining a method number_of_days that takes two parameters
months = {1: 31, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}#defining months variable that hold value in ictionary
l = leap_year(y)#defining l variable that calls leap_year method and holds its value
if l == 1 and m == 2:#use if that check l value equal to 1 and 2
return 29#return value 29
if m == 2:#use if that check month value equal to 2
return 28#return value 29
return months[m]#return months value
def days_left(d, m, y):#defining a method days_left that takes three variable in parameter
l = leap_year(y)#defining l variable that hold leap_year method value
days = 0#defining days variable that hold integer value
months = {1: 31, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}#defining months variable that hold value in ictionary
if l== 1:#using if that check l equal to 1
if m > 2:#defining if that check m value greater than 2
days += (29 + 31)#using days variable that Calculate holds its value
i = m#defining i variable that holds months value
while i > 2:#defining while loop that checks other days
days += months[i]#defining a days variable that holds months value
i -= 1#decreasing i value
days -= (months[m] - d)#defining days that subtracts leap value
elif m == 2:#defining elif block that checks m equal to 2
days += (29 - d) + 31#holding value in days variable
else:#defining else block
days = 31 - d#Calculating days value
return 366 - days#using return keyword that Calculates days value
else:#defining else block
if m > 2:#using if that checks m value greater than 2
days += (28 + 31)#Calculating and store value in days
i = m#holding months value in i
while i > 2:#defining while loop that checks i value greater than 2
days += months[i]#holding list value in days
i -= 1#decreasing i value
days -= (months[m] - d)#defining days that subtracts leap value
elif m == 2:#using elif block that checks m value equal to 2
days += (28 - d) + 31#Calculating and store value in days
else:#defining else block
days = 31 - d##Calculating and store value in days
return 365 - days#return total days
print("Please enter a date")#print message
day = int(input("Day: "))#input value
month = int(input("Month: "))#input value
year = int(input("Year: "))#input value
print("Menu: ")#print message
print("1) Calculate the number of days in the given month.")#print message
print("2) Calculate the number of days left in the given year.")#print message
c = int(input())#input value
if c == 1:#using if that checks c value equal to 1
print(number_of_days(month, year))#calling method and print its return value
elif c == 2:#using if that checks c value equal to 2
print(days_left(day, month, year))#calling method and print its return value
Output:
Please find the attached file.
Learn more:
brainly.com/question/16728668
Which of these are reasons to evacuate a building during an earthquake? Mark all that apply.
A. There is a water leak.
B. The building is on fire.
C. There is structural damage to the building like newly cracked walls.
D. There is a gas leak.
Answer:
D
Explanation:
Answer:
c, b
Explanation:
I am guessing those are correct I don't really know
True or False? You should never move an injured person.
True
False
Answer:
true
Explanation:
what is the depth of the following tree?
Answer:
The correct answer to this question is given below in the explanation section.
Explanation:
This given tree has four nodes. Node A is a parent node in this tree, while B, C, and D are child nodes of A.
The given options about the depth of the tree are:
A). 0B). 1C). 2D). 3The correct option to this question is (B) i.e. the depth of this tree is 1.
Because we know that the depth of a node M in the tree is the length of the path from the root of the tree to M. So, in this case, the depth of node A to node B, C, and D is 1. So, the correct option to this question is B. i.e the depth of the given tree is 1.
Write a for loop in python that prints 10 random numbers between 1 and 100 inclusive.
import random
for x in range(10):
print(random.randint(1,100))
What is a characteristic of tasks in Outlook?
The Tasks view can be seen by clicking the View tab.
New tasks are created in the Appointments form
Tasks are an action item in Outlook and are basically a to-do list.
Old tasks are automatically deleted from your list
Answer:
C. Tasks are an action item in Outlook and are basically a to-do list.
Explanation:
A to-do List is just a list of tasks.
and I took the test and got it right
Answer:
C. is correct
Explanation:
edg 2021
Which of the following is true about overloaded methods?
Answer:
Overloaded must have the same name but different parameter lists.
Explanation:
Given that in certain programming languages such as Java, the overload method is a means by which a specific word or symbol has more than one meaning or function, that Is, different parameters or executions but have the same name.
Hence, in this case, what is true about overloaded methods is that "Overloaded must have the same name but different parameter lists."
You wrote a program to find the factorial of a number. In mathematics, the factorial operation is used for positive integers and zero. What does the function return if the user enters a negative three? def factorial(number): product = 1 while number > 0: product = product * number number = number - 1 return product strNum = input("Enter a positive integer: ") num = int(strNum) print(factorial(num))
-6
1
-3
There is no output due to a runtime error.
Answer: well it’s not “There is no output due to a runtime error”
Explanation: Put that and I got it wrong
The Answer Is 1.
Edge 2020.
Given the formula on the left, label the parts. SUM . A2:D19 . E55 . (A2:A19,C13,E55,19) .
Answer:
SUM
✔ function name
.
A2:D19
✔ range
.
E55
✔ value
.
(A2:A19,C13,E55,19)
✔ argument
Answer:
1. B
2. A
3. A
4. C
Explanation:
On edge2020 I got it right
Myra just got the latest computer game and wants to play it on her desktop. When she plays the game, she notices that it is sluggish and the animations are not very clear. What can she do to improve her gaming experience?
Answer:
Ram/cpu/gpu... Many many things she can do
Explanation:
It may be a issue of internet bandwith, if this new game requires a insane ammount of internet then it may run low FPS (frames per second) and make myra's game look slughish,but anouther issue may be the ram or cpu, like if this is a new game and you've always played like simple games, so your running on persay a core i3 or i4, it aint gonna cut it on a newer game, you gonna need a probably core i5 or i7, or be like any sane person and switch to amd, it may be a bit pricy but if you want nice clean gaming, then amd is the way to go
Also while you are at it get a ssd
I hope this helps "-"
Answer:
She can upgrade her hardware/software
Explanation:
For hardware, she can troubleshoot any broken components that are possibly in the computer, upgrade cards/fans, etc.
and for software she can upgrade her operating system, upgrade or download any missing frameworks, clear out any software that is taking too much CPU/RAM in the background using task manager/system viewer/KSysGuard, etc.
What is the
binary code
for
"DMS"?
Answer:
D= 01000100
M= 01101101
S= 01110011
Explanation:
JAVA
Write a program that requests the user input a word, then prints every other letter of the word starting with the first letter.
Hint - you will need to use the substring method inside a loop to get at every other character in the String. You can use the length method on the String
to work out when this loop should end.
Sample run:
Input a word:
domain
dmi
import java.util.Scanner;
public class JavaApplication42 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Input a word:");
String word = scan.nextLine();
for (int i = 0; i < word.length(); i+=2){
System.out.print(word.substring(i,i+1));
}
}
}
I hope this helps!
The program is an illustration of loops.
Loops are used to carry out repetition operations; examples are the for-loop and the while-loop.
The program in Java, where comments are used to explain each line is as follows:
import java.util.*;
public class Main {
public static void main(String args[]) {
//This creates a Scanner object
Scanner input = new Scanner(System.in);
//This prompts user for input
System.out.print("Input a word: ");
//This gets input from the user
String userinput = input.nextLine();
//The following iterates through every other character of userinput
for(int i =0;i<userinput.length();i+=2) {
//This prints every other characters
System.out.print(userinput.charAt(i));
}
}
}
The above program is implemented using a for loop
Read more about similar programs at:
https://brainly.com/question/19104397
At the start of the school year, Brianna’s history teacher announces that students’ final grades will be weighted based on how they do in three categories: exams (60 percent), final presentation (30 percent), and class participation (10 percent). Which strategy would most likely help Brianna get the best grade? spending more time studying for exams than creating the final presentation splitting her time evenly between studying for exams and creating the final presentation concentrating on creating the final presentation and speaking up in class working hard at participating in class and studying for exams
Answer:
it is A
Explanation:
did on edge test
Answer:
A
Explanation:
.
Why does the Moon have a greater effect on the tides compared to the Sun? (Select WILL GIVE BRANLEST PLS ASAP
two.)
The Moon is smaller than the Sun.
The Sun is closer to the Earth.
The Moon’s gravitational pull on the Earth’s oceans is stronger.
The Moon is closer to the Earth.
The Sun’s gravitational pull on the Earth’s oceans is stronger.
The correct option that explains the reason why the moon will have greater effect on the tides compared to the sun is;
Option D; The moon is closer to the Earth
Generally speaking, ocean tides on the earth are caused by both the gravity of the moon and the gravity of the sun.Now, the mode of generation of ocean tides is not really by the total strength of gravity, but rather by the gravitational gradient.
Gravitational gradient is simply defined as the gravity differences from one spot to the other.
Now, from research, we know that the sun is far larger than the moon and this means in consequence it will have a far stronger total gravity than that of the moon. However, due to the fact that the moon is closer to the earth than the sun, it means the moon would possess a stronger gravitational gradient than which the sun possesses. Now, let's get to ocean tides; The ocean tides arise as a result of the response of ocean water to a gravitational gradient and as a result, the moon will have a greater role in creating tides than that which the sun does.Read more at; https://brainly.com/question/24996618
to develop vocabulary, a student should increase their
a) use of expression
b) use of punctuation
c) oral reading rate
d) familiarity with sight words
Choose a different well-known company that you know of, and describe its direct and indirect competitors. Describe at least 2 direct competitors and 2 indirect competitors.
Answer:
Apple
Direct Competitors: Microsoft and Samsung
Indirect Competitors: Best Buy and Target
correct on edge
Can you guys list all the Linux Debian Apps that can only be installed on a Linux terminal command line, I have a deb 32 bit
Answer:
Two of those are apt and apt get and the other one is dpkg. 4. You will see a list of Debian Ensure package lists and installed packages are up to date. ... Apt may fail to remove old Linux kernels when using an Ubuntu version that 39 s ... To install it just enter the following command from the Terminal sudo apt install apt ...
Explanation:
Laptop computers use PCMCIA cards, another type of ________
a.
USB drive
b.
mass storage
c.
smart cards
d.
flash memory
Answer:
mass storage or flash memory
What number will be output by the console.log command on line 5?
A. 10
B. 11
C. 12
D. 13
E. 16
Answer:
E
Explanation:
If you follow the line of code and add 1, 2, and then 3, 10 + 1 + 2 + 3 = 16.
The output of the block of code will be 16 as the value of the variable is assigned a new value based on the number added to it on each line.
The initial value of the variable oop is 10On the next line, 1 is added to oop and the resulting value is reassigned to the same variable, the new value of oop is 11On the next line, 2 is added to oop and the resulting value is reassigned to oop, the new value of oop becomes 13Variable oop is then increased by 3 ; making the value become (13 + 3) = 16Therefore, the output of the command is 16.
Learn more :https://brainly.com/question/18505492
In which area of the screen can features and functions of Word be accessed?
Command
Ribbon
Scroll bar
Tab
Please Hurry!!!
Answer:
Toolbar
Explanation:
j don't know if you meant that instead of scroll bar, but tool bar is the answer
Answer:
scroll bar
Explanation:
Instructions
Write a program that will add up the series of numbers: 99, 98, 97… 3, 2, 1. The program should print the running total as well as the total at the end. The program should use one for loop, the range() function and one print() command.
Sample Run
99
197
294
390
…
…
…
4940
4944
4947
4949
4950
total = 0
for x in range(99, 0, -1):
total += x
print(total)
I hope this helps!
Select the correct answer.
Adrian is organizing a training lecture for his students in various states simultaneously through radio, TV, and the Internet. What is this event
known as?
A. webcast
B. simulcast
C. broadband
D. online lecture
Answer:
a
Explanation:
a webcast is the answer I think
In an inequality between two numbers, -2.1 is located below the other number on a vertical number line. So, the other number is -2.1. One possible value of the other number is .
Answer:
-2.0
Explanation:
Given
Number = -2.1
Required
Determine the other number
From the question, we understand that the number is represented on a vertical number.
From bottom to top, numbers on a vertical number line increases.
Since the other number is at the top of -2.1, then we can conclude that this number is greater than-2.1
Hence, possible values are ,-2.0, -1.9, etc.
Answer:
First blank: greater than.
Second bank: -1.5
Explanation:
What is the value of the variable moneyDue after these lines of code are executed?
>>> numSodas = 2
>>> costSodas = 1.50
>>> moneyDue = numSodas * costSodas
Answer:
3.0
Explanation:
To understand why there is a blank decimal, we have to understand that when you add multiply or subtract with a float (in python), the result will also be a decimal, even you use a blank decimal in the equation. A circumstance where the output would just plain 3, you would have to put in the following:
>>>int(moneyDue)
To insure it will output an int. However, it does not use that line of code, thus proving the answer is 3.0.
hope this helped :D
Answer:
3.0
Explanation:
edge
Which statement is true about hacking?
Hacking is generally a positive practice to stop cyber crime.
Hackers do so for various reasons, including the challenge of it.
Hacking cannot be used in the process to help protect sensitive information.
Hackers are rarely successful when attempting to bypass security software.
Answer:
Hackers do so for various reasons, including the challenge of it
Explanation:
I would say it is this. Plz mark brainliest Thanks:)
Answer:
Hackers do so for various reasons, including the challenge of it
Explanation:
Analyze the map below and answer the question that follows. A topographic map of Northwestern Russia. Areas on the map are circled and labeled 1, 2, 3, and 4. 1 is a mountain range. 2 is a flat area. 3 is a highland area. 4 is a plateau. Image by Natural Earth The region labeled with the number 1 on the map above is the __________.
Answer:region 1
Explanation:
Answer:
region 1
Explanation:
correct on edg 2020
Keith has data in row 12. However, he would actually like that row to be empty. Keith should _____. A.) double-click on cell A12 and press Backspace B.) highlight row 12 and press Delete C.) use the arrow keys to move to row 12 and press Enter or Return D.) use the mouse to click row 12 and press the space bar
Answer:
B.)
Explanation:
In order to have that row, empty Keith should highlight row 12 and press Delete. This would delete all of the data in the row without effectively deleting the formulas. Therefore, allowing you to easily reuse the row if you need to add data to it once again. So this would be the best option for Keith as it easily solves the problem that he is having.
Which of the following allows a user to quickly access a frequently used computer app? Alphabetize program icons. O Create a shortcut on the toolbar. O Delete all icons on the screen. Place all icons in one folder.
Answer:
Create a shortcut on the toolbar
Explanation:
You can use process of elimination. alphabetizing would not help to find it quicker, but it is an easier way. Deleting all icons wouldn't help at all. And placing all icons in a folder would make it even messier. So, it is creating a shortcut. Plus, I got it right on my test :)
Answer:
its a shortcut
Explanation:
took da test and got 100
Use of the Internet for e-government has increased. Identify the benefits by checking all of the boxes that apply.
A. It keeps the public informed about events
B. People do not have to vote
C. People can pay bills
D. People do not have to visit the site
E. The government can share important information about issues with the people in that town.
Answer:
the answer is A C and E
Explanation:
CALCULATE THE PERCENTAGE OF FAT CALORIES TO TOTAL CALORIES. I got no idea how to do this in excel ;-;
Answer:
As you have the Fat Cal. in column C and the total calories in Column B, what you have to do is to divide column C by Column B.
For instance, in column E2, put the formula: =C2/B2.
Then drag the formula down so that the other formulas will be;
E3; =C3/B3
E4; =C4/B4
E5: C5/B5
E6: C6/B6
Then after that you go to the Home tab, then to the Number style section and format E2 to E5 to be percentages.
Write the line of code to calculate the area of a circle with radius 3 and store it in a variable called
area.
Answer:
area = 2.14 * 3 ** 2
Explanation:
No clue what language you use but this should be pretty universal. To find the area of a circle you use pi(r) ^ 2 or pi times radius squared
[tex]\pi r^{2}[/tex]
In python it looks like this:
>>> area = 3.14 * 3 ** 2
>>> print(area)
28.26 <Printed text