1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Juli2301 [7.4K]
3 years ago
11

Credit card numbers follow a standard system. For example, Visa, MasterCard, and Discpver Card all have 16 digits, and the first

digit serves to indicate the card brand. All Visa cards start with a 4; MasterCard cards always starts with a 5; and American Express cards start with a 2. Write a program that prompts for a 16-digit credit card and emits the name of the brand.Use the Try/Except/Else structure to ensure the user enters digits only. If the card brand cannot be determined or if the correct number of digits was not entered, the program should output "Unknown Card."
Computers and Technology
1 answer:
fgiga [73]3 years ago
5 0

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.

You might be interested in
The set of rules for how computers talk to one another
andrezito [222]
That is program ............
4 0
3 years ago
Pleaseee need help ASAP!!<br><br> Will mark BRAINLIEST!! :)
torisob [31]

Answer:

The correct option is Option B

Explanation:

We need to find examples of client-side code.

Client Side code: The part of code, that doesn't require server for performing specific task

SO, The correct option is Option B

Prompt for special characters in user name

Reason: We can use alert to generate prompt using JavaScript or through validation and it can be done on client side.

All other options, we need to hit the server to perform the task, So they are not client-side code.

6 0
2 years ago
The collection of all component frequencies iscalled _____________
yKpoI14uk [10]

Answer:

The answer is Frequency Spectrum.

Explanation:

The frequency spectrum is range of all component frequencies.It contains all the waves which are as following:-

Gamma Rays

X-Rays

Ultraviolet

Visible light.

Infrared

Micro wave

Radio wave

These all waves have their range of frequencies.The waves that are visible to us is only the visible light.

4 0
3 years ago
7.4.1C The global distribution of computing resources raises issues of equity, access, and power. Briefly describe one of these
nika2105 [10]

It has been accentuated. An organization is a system consisting of: people, material resources and information, being the last, the nerve center of the previous two that allows the survival of these. This statement refers to the most recent conceptions defended by the Information Management (IM), in the sense that organizations should be considered primarily as information systems.

Lynda Woodman's definition of IM states that "management is everything that refers to obtaining the right information, for the right person, at the right price, at the right time and place, to make the right decision."

As for the MIR, part of the assumption of recognition that information is a resource, a value that should be managed like any other, because among the similar characteristics we have:

* acquired at a cost and chargeable in money

* has specific and measurable characteristics

* control of the cost of information,

* has a life cycle,

* ability to be processed and refined, etc.

For Elizabeth Adams "the MIR is a function of top management, to develop a series of policies, programs and procedures to effectively and effectively plan, manage and control the information needs and support resources of information management." In this directive task, the components that participate and the areas in which the person responsible for it must operate are:

1.- information resources: that is, identification, evaluation and use of these, not only internal but also external.

2.- Appropriate technology: to collect, store, retrieve or disseminate information.

3.-management: general planning, human resources, communication, accounting and marketing.

In today's world, there is a tendency to grant special treatment to everything that is related to information; and it is this situation that gives rise to the importance of the management / management of information resources (MIR).

This era of information, characterized as significant changes, flexibility, uncertainty and the "great battles" (for competitiveness, leadership, competition, reduction of uncertainty and risk, etc.), it is necessary to keep updated as soon as to the significant changes that occur in the technology of products and processes, as well as in their management and competitiveness patterns.

We live in an era where the common denominator of progress will be the wise application of information, science and technology, in the production of goods and services for the satisfaction of social needs, as well as the adequate use of resources to increase the wellbeing of society and man. In others, words, we are talking about the correct management of information.

Information management is the new name of the development. Are the professionals (librarians, documentalists) ready to accept the challenge? We believe that information professionals are in an adequate situation, have knowledge, resources, capacity and conditions to maintain a sustainable leadership in the organization of information, but they have to determine what they believe their position should be and fight for it. We must start from the basic criteria, restructure the concept of the information scientist to adapt it to the new, complex and changing needs of the organization and the community.

6 0
3 years ago
Review the sentences about the accounting problem statement. Using the drop-down menu, identify if the sentence is part of the v
Tju [1.3M]
Issue
Method
Issue
Vision
8 0
3 years ago
Other questions:
  • Customer A with a Bronze service level package calls in a Critical System Failure at 9:00 AM. Customer B with a Silver service l
    15·1 answer
  • PLEASE HURRY
    6·1 answer
  • What is the purpose of filters in a data base
    11·1 answer
  • The while loop has two important parts: a condition that is tested and a statement or block of statements that is repeated as lo
    8·1 answer
  • The PRNG variable ___________ is defined in NIST SP 800-90 as a number associated with the amount of work required to break a cr
    7·1 answer
  • True or False (type the entire word)
    11·1 answer
  • What is a benefit of the Name Manager feature?​
    12·2 answers
  • Which search engine does not track users? Choose the answer.
    10·2 answers
  • Who developed the first triage-like system for Napoleon's ar
    15·1 answer
  • What is an automatic update and when should you use it
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!