Answer:
try:
cardNumber = str(input('Enter your card number her: \n'))
if (len(cardNumber) > 16 or len(cardNumber < 16)):
raise
except:
print ('You have entered an invalid cardNumber.')
else:
if cardNumber.startswith("2"):
print('American Express Card')
elif cardNumber.startswith("4"):
print('Visa Card')
elif cardNumber.startswith("5"):
print('Master Card')
else:
print('Unknown Card')
Explanation:
In the try block section:
The first line prompt the user for input, which is converted to string and assigned to cardNumber variable. The next line test the length of the cardNumber entered, if it is less than 16 or greater than 16; an exception is raise.
In the except section:
An error message is displayed telling the user that he/she has entered an invalid card number.
In the else section:
This is where is program check for type of card using an if...elif...else statement block. If the cardNumber start with 2; an output of "American Express card" is displayed. If the cardNumber start with 4; an output of "Visa card" is displayed. If the cardNumber start with 5; an output of "Master card" is display else "Unknown card" is displayed to the user.
Answer:
The code is given below in Java with appropriate comments
Explanation:
//Import the input.
import java.util.Scanner;
class CensoredWords
{
//Define the main method.
public static void main(String args[ ])
{
//Define the variables.
String userInput="" ;
//Define the scanner object
Scanner scobj = new Scanner(System.in);
//Accept the userInput.
System.out.print("Enter String: ");
userInput=scobj.nextLine();
//Check if the input contains darn.
//Print censored.
if(userInput.toUpperCase().indexOf("DARN") != -1)
System.out.printf("Censored");
//IF the input does not contains darn
//Print userInput.
else
System.out.printf(userInput)
return;
}
}
Answer:
Archiving data files manages the size of a mailbox for
✔ local
storage.
Creating an Outlook data file
✔ protects
data files in storage on a computer.
Explanation:
Because its right.
Answer is: Dispersants
Explanation:
Dispersants keep contaminants (e.g. soot) suspended in the oil to prevent them from coagulating. Anti-foam agents inhibit the production of air bubbles and foam in the oil which can cause a loss of lubrication, pitting, and corrosion where entrained air and combustion gases contact metal surfaces.
So that's why the answer is: Dispersants
Answer:
<u>COPA full form or meaning is Computer Operator and Programming Assistant.</u>