Answer:
- def calcSum(d):
- sum = 0
- for x in d:
- sum += int(x)
- return sum
-
- digits = input("Please enter your digits: ")
- print(calcSum(digits))
Explanation:
The solution code is written in Python.
Firstly, create a function that take one input digit string (Line 1).
In the function, create a sum variable with initial value 0.
Use a for loop to traverse through each character in the digit string and in the loop use int method to convert each character to integer and add it to sum variable (Line 3-5) and return the sum as output.
Next, use input function to prompt user enter a digit string (Line 7).
Lastly test the function by passing the input digit as argument and print the result (Line 8).
Answer:
Ctrl+Alt+Del
Explanation:
It will take you to the task manager and you can highlight the program that is frozen, right click on it and select end task. Or hard reboot as a last resort.
Answer:
Log in to iCloud.com on a browser
Explanation:
On your browser which should be a supported browser, you should log in to iCloud.com since iCloud is not supported on mac OS X earlier than mac OS X Lion 10.7.5
Answer:
The correct answer is B. Africa
Explanation:
African Institute for Mathematical Sciences (AIMS) was founded in 2003 having its first center in Cape Town, South Africa. AIMS provides training for Africa's talented university graduates needed to enter technical professions or pursue graduate studies in technical fields. The Next Einstein Initiative (NEI) is a strategic plan to build on the success of the first AIMS centre and create a coordinated pan-African network of 15 AIMS centres by 2020, producing 750 well-qualified graduates per annum. AIMS won the Google's Project 10^100 and also the founder of AIMS won the TED Prize and announced his vision to unlock scientific talent across Africa.
Answer:
// Program is written in C++ Programming Language
// Comments are used for explanatory purpose
// Program starts here
#include<iostream>
using namespace std;
int main ()
{
// Declare Variable
int selection;
// Prompt user to make a selection of medium between air, water or steel.
cout<<"Make Selection"<<'\n'<<"Press 1 for Air"<<'\n'<<"Press 2 for Water"<<'\n'<<"Press 3 for Steel";
cin>>selection;
// Check for entry
if(selection == 1) {
cout<<"You selected Air"<<'\n';
cout<<"The distance travelled by sound wave in air is 1,125 feet in 1 second";
}
else if(selection == 2) {
cout<<"You selected Water"<<'\n';
cout<<"The distance travelled by sound wave in water is 4859 feet in 1 second";
}
else if(selection == 3) {
cout<<"You selected Steel"<<'\n';
cout<<"The distance travelled by sound wave in steel is 19554 feet in 1 second";
}
else
cout<<"Invalid Selection";
return 0;
}