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.
Answer:
tamera like from sister sister hehe
Explanation:
sorry i dont know the awnser
Answer: Scope resolution operator(::)
Explanation: A member function and the constructor can be called within the function easily but for the execution of the these components outside the class , a special operator is required to call the functions. The scope resolution operator(::) preceding with the name of class is thus used for defining of the function outside class.This operator maintains the cope of the function and constructor outside the class.
Answer:
//class Name
class Name {
// attributes gave you 3
String first_name;
String last_name;
int length = 0;
//constructor with 2 parameters
Name(String first_name, String last_name){
}
//methods
public String find_printed_name(){
return first_name + " " + last_name;
}
public void find_sortable_name(){
return last_name + ", " first_name.charAt(0);
}
public static void main(String[] args){
// instantiate the class
Name test_name = new Name("David", "Joyner");
System.out.println(test_name.first_name);
System.out.println(test_name.last_name);
System.out.println(test_name.find_printed_name());
System.out.println(test_name.find_sortable_name());
}
Explanation:
You didn't specify a language so I did it in Java.
You should know how to declare methods in Python.