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]
4 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]4 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
Select the components of a search engine.
Assoli18 [71]

Answer:

C because whatever a search engine is it will need a search form to do its job, so C (maybe d)

7 0
4 years ago
Read 2 more answers
Access your Practice Lab titles Access your exercise content Reports and files Access your settings Access help and support Comp
Degger [83]

Answer:

The extension for a shell script in windows ends with a .ps1 and for the extension for linux it is .sh, not quite sure for OSX.

4 0
3 years ago
What do you think would have happened if early explorers had not followed their maps, charts, and compasses? (Give 4 examples in
enyata [817]

Answer:

If the explorers wouldn’t have followed their maps they would have gotten lost. Another thing that might of happened is maybe they would find someplace cool but they have no idea where they are. Without a map most captains would have probably been going in circles for years. Imagine if you didn’t have a map, you probably would have thought you were going to fall of the side of the earth, because back then the explores thought the earth was flat.

Explanation:

:) ur welcome hope I helped

8 0
3 years ago
Question # 6
ziro4ka [17]

Answer:

Scope.

Explanation:

In programming, the scope could be static, private or public and in those, defines the scope of a specific variable.

Ex.

public int x = 0; // Can be seen when called within a whole class and outside of a class/ function.

private int y = 0; // Can be seen only within the class its defined in.

static pub/priv int z = 0; // Uncangeable variable that can be defined in both class and external class, depending on the two prior scopes defined after.

int aa = 0; // Defaults to private.

5 0
3 years ago
Read 2 more answers
Network administration is concerned with which tasks?
Yuri [45]

A user hacking or looking up utter nonsense....sorry if it didn't help

3 0
4 years ago
Read 2 more answers
Other questions:
  • An electronic resume is a plain-looking document. True of False?
    6·2 answers
  • Which of the following is a goal of paraphrasing and summarizing?
    14·2 answers
  • Which of the following is not an algorithm?
    8·1 answer
  • What are two great ways to find clues to locate commands on the ribbon?
    13·1 answer
  • A flowchart that depicts the relationships among the input, processing, and output of an AIS is
    6·1 answer
  • I have two questions: 1: how do you credit only 5 points on brainl? (mine is only letting me give 10) and 2. How do I get a bria
    6·2 answers
  • What is an unknown network called
    6·1 answer
  • Adding videos to your website can be tricky because there may be problems making sure they will play in all
    13·1 answer
  • Google is an example of a(n):
    13·1 answer
  • Visme,PowerPoint, keynote and prezi are what kind of software
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!