Answer:
<em>Written in Python</em>
def SumN(n):
total = 0
for i in range(1,n+1):
total = total + i
print("Total: ",total)
def SumNCubes(n):
total = 0
for i in range(1,n+1):
total = total + i**3
print("Cube: ",total)
n = int(input("User Input: "))
if n > 0:
SumN(n)
SumNCubes(n)
Explanation:
The SumN function is defined here
def SumN(n):
This line initializes the total to 0
total = 0
The following iteration compute the required sum
<em> for i in range(1,n+1):
</em>
<em> total = total + i
</em>
This line outputs the calculated sum
print("Total: ",total)
The SumNCubes function is defined here
def SumNCubes(n):
This line initializes the total to 0
total = 0
The following iteration compute the required sum of cubes
<em> for i in range(1,n+1):
</em>
<em> total = total + i**3
</em>
This line outputs the calculated sum of cubes
print("Cube: ",total)
The main starts here; The first line prompts user for input
n = int(input("User Input: "))
The next line checks if input is greater than 0; If yes, the two defined functions are called
if n > 0:
SumN(n)
SumNCubes(n)
Answer:
1. Industrial revolution was initiated or borne through the production of Steel
2. World War 1 led to the development of Tanks
Explanation:
The production of Steel through the Bessemer Process in the middle of the nineteenth century was a major technological development that spurred the Industrial revolution. This invention led to the widespread use of steel in the production of many things including vehicles and airplanes.
During the First World War in 1914, soldiers found the use of just their armaments in battle as not so productive. This led to the development of Tanks in 1915 that would continue moving towards the enemy even when being shot at.
Answer:
SELECT distinct VendorName FROM Vendors
WHERE VendorID IN (
SELECT VendorID FROM Invoices
)
Explanation: