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
Nostrana [21]
3 years ago
8

Write a program that inputs an integer denoting a month (1 for January, 2 for February, ... , 12 for December), and outputs how

many days are in that month. Assume no leap years. For example, if the input is 2, the output is 28. If the input is 11, the output is 30.[ There are a variety of ways to do this...One approach is to use 12 separate if-then statements. Another approach uses just 3 if-then statements and the logical OR operator (which is ||). ]
Computers and Technology
1 answer:
Korolek [52]3 years ago
6 0

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variable

int inp_month;

cout<<"Enter month:";

// read month

cin>>inp_month;

// if month is february

if(inp_month==2)

cout<<"Number of days in month:28"<<endl;

// if month is 4 or 6 or 9 or 11

else if(inp_month==4||inp_month==6||inp_month==9||inp_month==11)

cout<<"Number of days in month:30"<<endl;

else

// for others month

cout<<"Number of days in month:31"<<endl;

return 0;

}

Explanation:

Read month from user and assign it to variable "inp_month".If month is 2 then  there is 28 days in the month.If input month is 4 or 6 or 9 or 11 then there is 30 days in the month.For other month there will be 31 days in month.We assume there is no leap year.

Output:

Enter month:4                                                                                                              

Number of days in month:30

You might be interested in
4.8 code practice question 2
Anna35 [415]

Answer:

Written in Python

for count in range(88, 42,-2):

    print(count,end=' ')

Explanation:

The programming language is not stated.

However, I used python to answer the question.

First, we need to loop from 88 to 44 with a difference of -2 in each term.

This is implemented as

for count in range(88, 42,-2):

Which means to start at 88 and ends at 42 - (-2) which is 44 with an increment of -2

Next, is to print the current iterating value;

This is implemented using print(count)

However, since all values are to be printed on a line, there's a need t modify the statement as: print(count,end=' ')

4 0
3 years ago
Choose the word that best completes this sentence. Caught-in and caught-between injuries result from a person being squeezed, ca
salantis [7]
Two adjacent
Two parallel
3 0
4 years ago
Read 2 more answers
Create a file named homework_instructions.txt using VI editor and type in it all the submission instructions from page1 of this
KATRIN_1 [288]

Answer:

mkdir homeworks    // make a new directory called homeworks.

touch homework_instructions.txt //create a file called homework_instruction

sudo -i    // login as root user with password.

chmod u+rwx homework_instructions.txt  // allow user access all permissions

chmod go-wx homework_instructions.txt // remove write and execute permissions for group and others if present

chmod go+r homework_instructions.txt  // adds read permission to group and others if absent.

grep POINTS homework_instructions.txt | ls -n

Explanation:

The Linux commands above first create a directory and create and save the homework_instructions.txt file in it. The sudo or su command is used to login as a root user to the system to access administrative privileges.

The user permission is configured to read, write and execute the text file while the group and others are only configured to read the file.

6 0
3 years ago
Which of the following is most often true?
Ksenya-84 [330]

Answer:

a) The IOS is stored in flash and copied into RAM at startup.

Explanation:

Well,  in most router architectures, the IOS is copied into and run from RAM. This is because of the flash allows the IOS to be upgraded in any moment or allows it  to stores multiple IOS files.

Keep in mind that if the flash memory is empty, the router will try to use a TFTP server to load an IOS image from the network and for the last resort if the TFTP server is unavailable, the router will load the limited version Cisco IOS software image stored in ROM.

5 0
3 years ago
A(n) is the tool that will help you the most when developing the content you will use in your presentation.
ikadub [295]

Answer:

Outline

Hope it helps :)

Explanation:

7 0
3 years ago
Other questions:
  • How to build a communication network
    13·1 answer
  • Write a method named showChar. The method should accept two arguments: a reference to a String object and an integer. The intege
    6·1 answer
  • What does it mean when you mail is labled unable to forward for review
    5·1 answer
  • How many different Roblox games were played in 2018​
    9·2 answers
  • An EULA usually takes the form of an electronic notification that appears when installing software. The user then has a choice t
    14·1 answer
  • Answer 1 question and get 10 points in return
    10·2 answers
  • Why are abbreviations like BRB, TBH, and IDK appropriate in some situations but not in others?
    14·2 answers
  • The Ingenuity and the MOXIE are two new pieces of technology on the Perseverance. What role will these instruments play? How wil
    6·2 answers
  • A Development team begins work on a new software application and decides to involve the client’s IT experts to ensure that secur
    12·1 answer
  • Give the value of the zero flag, the carry flag, the signflag, and the overflow flag after each of the following instructions if
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!