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
A regular polygon is an n-sided polygon in which all sides are of the same length and all angles have the same degree (i.e.,the
butalik [34]

import java.util.Scanner;

public class polygon {

/** Main Method */

public static void main(String[] args) {

 Scanner input = new Scanner(System.in); // Create a Scanner

 // Prompt the user to enter the number of sides  

 // and the side of a regular polygon

 System.out.print("Enter the number of sides: ");

 int n = input.nextInt();

 System.out.print("Enter the side: ");

 double side = input.nextDouble();

 // Display the area of the regular polygon

 System.out.println("The area of the polygon is " + area(n, side));

}

/** Method area computes and returns the area of a regular polygon */

public static double area(int n, double side) {

 return (n * Math.pow(side, 2) / (4 * Math.tan(Math.PI / n)));

}

}

4 0
3 years ago
The most widely used presentation software program is Microsoft PowerPoint. You can produce a professional and memorable present
Feliz [49]

Answer:

Light text on a dark background

Explanation:

Microsoft PowerPoint is an application software in which the company ables to introduce themselves by making slides and presented to an audience in an easy and innovative way. In this,  we can add pictures, sound, video by adding the different text, colors, backgrounds, etc

For memorable and professional presentations, the light text on a dark background is a best combination as it is easy to read and give the best view of the message you want to convey.

8 0
3 years ago
Alice is working on a web page to attract the maximum number of people to join her cause. She wants to inform people about the b
Deffense [45]

Answer:

Option D.    Persuasive writing style

is correct answer.

Explanation:

  • Alice should adopt the persuasive writing style as she wants to convince the people to adopt eco-friendly methods of living.
  • When a person write persuasively, this means he/she will present justifications and reasons for that specific opinion he/she is trying to convince the audience.
  • For the correctness of their opinion, different kinds of evidences are prepared so that the fact persuade the reader.
  • Persuasive writing is used widely while writing academic papers, advertisements  and argumentative essays as well.
<h2></h2><h2>i hope it will help you!</h2>

7 0
3 years ago
Why does my internet keep disconnecting and reconnecting.
3241004551 [841]

Answer:

Hmm maybe because its failing?

Explanation:

i actually dont know but it happens to me sometimes

6 0
2 years ago
When is it appropriate to utilize the nat network connection type?
lbvjy [14]
Whenever the VM does not need to be access at a known address by other network nodes.
6 0
2 years ago
Other questions:
  • Why is television reactive, requiring no skills or thinking
    11·1 answer
  • In your memo, give three new employees directions for starting the computer and opening a word-processing document.
    9·1 answer
  • What is output by the following program? int i = 7; while (i&gt;=2){System.out.print (i +""); if ((i%3) == 0){ i +2; } else { i/
    6·1 answer
  • how to make assignment on power point plz cntct me and help me all about power point and my assignment is prime ministers of pak
    13·1 answer
  • What your computer can do to you?
    14·2 answers
  • Please code this in c++
    10·1 answer
  • Once secured a wheelchair may move up to 6 inches in any direction
    6·1 answer
  • Brake fluid should be checked __________.
    8·2 answers
  • Cloud computing is an old phenomenon in computing infrastructure dating back to the early days of the Internet that involves mov
    10·1 answer
  • An address has a house number, a street, an optional apartment number, a city, a state and a postal code. Define the constructor
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!