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
sergey [27]
2 years ago
14

Light travels at 3 × 108 meters per second. A light-year is the distance a light beam travels in one year.Write a PYTHON program

that calculates and displays the value of a light-year.Useful facts:Seconds in a year = 365×24×602Rate = 3×108meters per second
Computers and Technology
1 answer:
Volgvan2 years ago
4 0

Answer: This is a python code

def lightyear():

   rate=3*100000000   //speed of light

   seconds=365*24*60*60   //number of seconds in 1 year

   return str((rate*seconds)/1000)+" km"    //distance=speed x time

print(lightyear()) //will print value of light hear in kilometers

OUTPUT :

9460800000000.0 km

Explanation:

In the above code, there is a variable rate, which stores the speed of light, i.e. distance traveled by light in 1 second which is in meters. Another variable is seconds, which store the number of seconds in 1 year, which is no of days in 1 year multiplied by the number of hours in a day multiplied by the number of minutes in an hour multiplied by the number of seconds in a minute. Finally, distance is speed multiplied by time, so distance is printed in kilometers and to convert distance in kilometers it is divided by 1000.

You might be interested in
A computer processes data only using 1s and 0s
ArbitrLikvidat [17]
Yes it only processes data using 1s and 0s
8 0
3 years ago
Read 2 more answers
a customer receives a message from the bank asking him/her to provide login information. assuming the message is intended to def
gizmo_the_mogwai [7]

The type of infiltration technique used here is phishing. Phishing is a form of social engineering attack that is often used to obtain user information such as login and credit card information.

Phishing is a type of social engineering in which an attacker delivers a false (e.g. fake, fake, or other deceptive) communication designed to trick a person into providing critical information to the attacker, or to install malicious software, such as ransomware, on the victim. infrastructure.

Phishing attacks are becoming more sophisticated and often transparently mirror the website being attacked, allowing the attacker to track everything the victim is doing there and bypass other security barriers with them.

By far the most common attack by hackers as of 2020, according to the FBI Internet Crime Complaint Center, which records more phishing incidents than any other type of cybercrime combined.

To know more about phishing click here:

brainly.com/question/24156548

#SPJ4

7 0
10 months ago
A disadvantage of ethernet??
Blababa [14]
Ethernet is a wired internet connection. So, one obvious draw back is you can only go so far as your Ethernet cable will allow you.
3 0
3 years ago
The icons to insert pictures and clip art in the PowerPoint application are located in the _____ grouping on the Insert tab.
saul85 [17]
The icons to insert pictures and clip art are located in the images grouping on the insert tab.
3 0
3 years ago
Assume the existence of a Window class with a function getWidth that returns the width of the window. Define a derived class Win
Pepsi [2]

Answer:

Following are the code in the C++ Programming Language.

//define class and inherited the parent class

class WindowWithBorder : public Window

{

//access modifier

private:

//set integer variable

int borderWidth;

//set integer variable

int windowWidth;

//access modifier

public:

//definition of the constructor that accept an integer type argument

WindowWithBorder(int);

//definition of the function

int getUseableWidth();

};

//set constructor outside the class

WindowWithBorder::WindowWithBorder(int y)

{

//initialization in integer variable from function

windowWidth = getWidth();

//initialization in integer variable from the argument list

borderWidth = y;

}

//set function from outside the class

int WindowWithBorder::getUseableWidth()

{

//return output

return windowWidth - borderWidth;

}

Explanation:

Here we define a class "WindowWithBorder" which inherit their parent class "Window", inside the class.

  • Set two integer data type private variables "borderWidth" and "windowWidth".
  • Write the definition of the "windowWidth" class constructor that accept the integer type argument list.
  • Write the definition of the function "getUseableWidth()" which is integer type.

Then, we define constructor outside the class which accept the integer type argument list "y" inside it.

  • we initialize in the variable "windowWidth" from the function "getWidth()".
  • Initialize in the variable "borderWidth" from the argument of the constructor.

Finally, we define function in which we perform the subtraction of the variable "windowWidth" from the variable "borderWidth" and return it.

5 0
3 years ago
Other questions:
  • Mary is troubleshooting her company's LAN network. She finds out that data segments that the client is encoding are resulting in
    9·1 answer
  • Consider the following sequence of items 10, 36, 25, 54, 37, 12, 75, 68, 42, 86, 72, 90. Insert these items in the order above,
    5·1 answer
  • An identifying value called a/an ____ is assigned by the java runtime to an object when it is created, to allow the java runtime
    14·1 answer
  • Int a=10 int b=20<br> A=b<br> The new values for a and b are
    11·2 answers
  • Debug the following program.
    5·1 answer
  • What is digital scavenger hunting? A. An application that locates addresses B. A scavenger hunt where players use GPS and digita
    5·1 answer
  • Which memory can be removed from motherboard? RAM OR ROM?​
    11·1 answer
  • Consider the following declaration:
    9·1 answer
  • Which statement about analog and digital images is true?.
    15·1 answer
  • Identify the calculation performed by the following code.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!