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
Vanyuwa [196]
3 years ago
11

Write a program named CheckMonth that prompts a user to enter a birth month. If the value entered is greater than 12 or less tha

n 1, display the error message Invalid month; otherwise, display the valid month with a message such as 3 is a valid month.
Computers and Technology
1 answer:
klemol [59]3 years ago
3 0

Answer:

Program:

month=['January', 'Februrary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] #list which stores the name of the month.

CheckMonth= int(input("Enter the number of the month")) #it is used to take the inputs from the user.

if CheckMonth>=1 and CheckMonth<=12: #check the condition for valid month.

   print(str(CheckMonth)+" is a valid month which name is: "+ str (month [CheckMonth-1])) #print the name of month which is enter by the user.

else:

   print(str(CheckMonth)+" is not a valid month, please enter the valid month") # print for the invalid month.

Output:

  • If the user inputs 1, it will prints "1 is a valid month which name is: January".
  • If the user inputs is 0, then it will prints "0 is not a valid month, please enter the valid month"

Explanation:

  • The above program is in python language, in which the first line of the code is used to hold the list of the month.
  • Then the second line is used to render a message for the user input, take the input from the user and save it into a variable.
  • Then that value is checked by the if-condition that it lies in between 1 to 12 or not.
  • If it lies, then print the valid month otherwise it prints that the month is invalid.
You might be interested in
Write the features of Mark-I.​
kotegsom [21]

Answer:

mark- I was enormous in size,measuring 8 feet high,51 feet long and 3 feet deep it weighs tons used , 530 miles of wire and 730,000 separated plant.

4 0
3 years ago
Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print o
bearhunter [10]

A program that repeatedly prompts a user for integer numbers :

biggest = none

smallest = none

while True:

input = raw_input(“Enter a number:”)

if(input == “done” break

try:

 number = float(inp)

 except ValueError:

 print “Please enter only numbers”

else

 if smallest is None:

  smallest = number;

  biggest = number;

elif number < smallest:

 smallest = number

elif num > largest:

 largest = number

Print “Greatest is “, biggest

Print “Smallest is”, smallest

In this program an input is obtained, if it is equal to the word “done”, then the program stops b printing greatest and smallest number in the given input.

If invalid inputs are given then user is prompted to enter valid number. Otherwise the value of smallest and greatest are calculated according to the input using if-else construct.

6 0
3 years ago
Custom parameters 1, 2 and 3 provide the same end value for all keywords. true or false?
lesya [120]
Is a Microsoft Bing ads certification Exam question.
I think that the correct answer is:
False

Source and more info: <span>https://goo.gl/JUw7Bw</span>
3 0
3 years ago
Florida revoked __________ drivers licenses for DUI in a one-year period from 2009 to 2010.
rusak2 [61]
<h2>Answer:</h2>

<u>Florida revoked </u><u>36872 </u><u>drivers licenses for DUI in a one-year period from 2009 to 2010.</u>

<h2>Explanation:</h2>

The word DUI means Driver under influence. This influence is usually under alcohol or any other drug. A DUI arrest means when someone is caught driving a vehicle while under the influence of alcohol or drugs. One can still get a DWI if one is pulled over for some reason other than erratic driving.  120 days minimum mandatory jail and up to one year jail maximum may be imposed for DUI but it depends on state to state laws.

6 0
3 years ago
Read 2 more answers
Another name for a computer's operating system
nadya68 [22]

Answer:

core engine or system software.

Explanation:

just because

5 0
3 years ago
Read 2 more answers
Other questions:
  • Shelly praised Susan via email for how well she executed an employee training program last week. Shelly is engaging in the _____
    6·1 answer
  • How can people make sure they are using credit cards responsibly
    14·2 answers
  • When you move or size a control in the Form Designer, Visual Studio automatically adjusts the ________________ that specify the
    9·1 answer
  • What data discovery process, whereby objects are categorized into predetermined groups, is used in text mining?
    12·1 answer
  • Please code this in c++
    10·1 answer
  • After reading the article, "The Impact of Technology", answer the following question.
    7·1 answer
  • An Organization Chart to support the Appliance Warehouse case study The SWOT Analysis diagram you performed and created to suppo
    13·1 answer
  • Software is the word for:
    15·1 answer
  • Write a function called prod_all that takes any number of arguments and returns their sum. Test the function by using these two
    10·1 answer
  • Pam wants to make a note for other programmers in her Python code. How should the line of code for the note begin?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!