Answer:
The program to this question as follows:
Program:
def lettersOnly(s): #defining method lettersOnly
val="" #defining string variable that return value
for i in s: #defining loop to calculate value
if(i.isalpha()): #check condition that value is string
val=val+ i #add value
return val #return value
print(lettersOnly("data3base_ro1c3k5s")) #call method and print value
Output:
databaserocks
Explanation:
In the above python code, a method lettersOnly is declared that accepts a string variable "s" in its parameter. Inside the method, a string variable "val", and loop is declared, in which the "val" variable holds method return value.
- In the loop and if block is used that uses "isalpha" string method, which checks the check alphabetic character in the given value. if this is true it will calculate all value in "val" variable and return its value.
- At the last, the print method is used, which calls the lettersOnly method and prints its return value.
Answer:
#include <iostream>
using namespace std;
int main()
{
int mt, day, yr, magic;
cout << "Enter a month(numeric form)"<< endl;
cin >> mt;
cout << "please enter a day"<<endl;
cin >> day;
cout << "please enter a year"<< endl;
cin >> yr;
// Input Validation
if (mt<1 || mt>12){
cout<<"Invalid Month";
}
else if (day<1||day>31){
cout<<"Invalid Day";
}
else if (yr>99||yr<0){
cout<<"Invalid Year";
}
else{
// Calculates magic
magic = (mt * day);
if (magic == yr)
{
cout << "it is a magic year"<<endl;;
}
else
cout << "It is not a magic year" << endl;
}
return 0;
}
Explanation:
Using C++ we request the user to enter values for Month, day and year (two digits). We carry out input validation to ensure the user enters a valid month, day and year. Using if/elseif/if statements we ensure the conditions given in the question.
Some computer speakers have equalization features such as bass and treble controls. Bluetooth speakers can be connected with a computer by using an Aux jack and compatible adaptor. More sophisticated computer speakers can have a subwoofer unit, to enhance bass output.
Hope that helps....it on googIe
The answer is UNIX which is a multipurpose operating system because it is both stand alone and network operating system
Answer:
Word processors allow users to save documents. This is not the case with a typewriter. Because text can be saved, editing does not have to occur immediately. The fourth characteristic of word processors is that they allow users to print their documents.