Answer:
def newton(n):
#Define the variables.
t = 0.000001
esti = 1.0
#Calculate the square root
#using newton method.
while True:
esti = (esti + n / esti) / 2
dif = abs(n - esti ** 2)
if dif <= t:
break
#Return the result.
return esti
#Define the main function.
def main():
#Continue until user press enters.
while True:
try:
#Prompt the user for input.
n = int(input("Enter a number (Press Enter to stop):"))
#display the results.
print("newton = %0.15f" % newton(n))
except:
return
#Call the main function.
main()
Answer:
Explanation:
When most non-technical people hear the term “seven layers”, they either think of the popular Super Bowl bean dip or they mistakenly think about the seven layers of Hell, courtesy of Dante’s Inferno (there are nine). For IT professionals, the seven layers refer to the Open Systems Interconnection (OSI) model, a conceptual framework that describes the functions of a networking or telecommunication system.
The model uses layers to help give a visual description of what is going on with a particular networking system. This can help network managers narrow down problems (Is it a physical issue or something with the application?), as well as computer programmers (when developing an application, which other layers does it need to work with?). Tech vendors selling new products will often refer to the OSI model to help customers understand which layer their products work with or whether it works “across the stack”.
Layer 7 - Application
To further our bean dip analogy, the Application Layer is the one at the top--it’s what most users see. In the OSI model, this is the layer that is the “closest to the end user”. It receives information directly from users and displays incoming data it to the user. Oddly enough, applications themselves do not reside at the application layer. Instead the layer facilitates communication through lower layers in order to establish connections with applications at the other end. Web browsers (Google Chrome, Firefox, Safari, etc.) TelNet, and FTP, are examples of communications that rely on Layer 7.
Layer 6 - Presentation
The Presentation Layer represents the area that is independent of data representation at the application layer. In general, it represents the preparation or translation of application format to network format, or from network formatting to application format. In other words, the layer “presents” data for the application or the network. A good example of this is encryption and decryption of data for secure transmission - this happens at Layer 6.
Answer:
SELECT paintname, COUNT(paintname) as count_paintname
FROM paint
GROUP BY paintname HAVING COUNT(paintname) > 2
ORDER BY paintname
Explanation:
The structured query language or SQL statement returns two columns of paintname and the count of the distinct paint names in the paint table with rows of grouped paint names greater than two and in the ascending order of the names.
Answer:
15
Explanation:
if ..else is the conditional statement which is used to check the condition is true or not, if the condition is true that execute the particular statement and if not it moves to else part for execution.
if condition is more than two we can use continuous if else statement
Syntax:
if(condition)
{
statement;
}else if(condition)
{
statement;
}else
{
statement;
}
In the code:
The value of the input is 5.
first it goes to if part and check condition if 5 > 5, condition false it equal to 5 not greater than 5.
it then moves to else if part and check condition if 5 > 2, condition is true,
it execute the code inside the else if part. so, input_value become
5+10 which 15.
after that, program control terminate the if else statement it does not check further.
Presentation software is probably his best option. It would allow him to present visual and audio supplements to his audience.