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
taurus [48]
2 years ago
5

Write a program that would determine the day number in a non-leap year. For example, in a non-leap year, the day number for Dec

31 is 365; for Jan 1 is 1, and for February 1 is 32. This program will ask the user to input day and month values. Then it will display the day number day number corresponding to the day and month values entered assuming a non-leap year. (See part II to this exercise below).
Computers and Technology
1 answer:
SOVA2 [1]2 years ago
7 0

Answer:

In Python:

months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]

daymonths = [31,28,31,30,31,30,31,31,30,31,30,31]

day = int(input("Day: "))

month = input("Month: ")

ind = months.index(month)

   

numday = 0

for i in range(ind):

   numday+=daymonths[i]

numday+=day

print(numday)    

Explanation:

This initializes the months to a list

months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]

This initializes the corresponding days of each month to a list

daymonths = [31,28,31,30,31,30,31,31,30,31,30,31]

This gets the day from the user

day = int(input("Day: "))

This gets the month from the user

month = input("Month: ")

This gets the index of the month entered by the user

ind = months.index(month)

This initializes the sum of days to 0

numday = 0

This adds up the days of the months before the month entered by the user

<em>for i in range(ind):</em>

<em>    numday+=daymonths[i]</em>

This adds the day number to the sum of the months

numday+=day

This prints  the required number of days

print(numday)    

<em>Note that: Error checking is not done in this program</em>

You might be interested in
A national tax preparation firm is accessing industry-specific productivity applications in the cloud; many other tax preparatio
Andreas93 [3]

Answer:

software as a service(SaaS) model

Explanation:

This is because the software applications are accessed over the internet meaning no need for infrastructure installation and maintenance.

8 0
3 years ago
Which subunit of a heterodimeric cdk is the regulatory subunit?
Lemur [1.5K]
The answer is cyclin subunit
8 0
2 years ago
Which method do software testers use to isolate new code from the rest of the network during the test stage of the software deve
disa [49]

Answer:

Sandboxing.

Explanation:

SDLC or software development life cycle is a systematic approach to software development. It marks the birth and death of an application.

The application development starts from the research of the properties of the application to the design and development or implementation of the application.

After the implementation of the software, it is tested, comparing the design and the codes in the development process. The sandboxing testing process helps to isolate and test new lines of code added during the testing phase.

3 0
3 years ago
Which of these statements about digital media is NOT accurate?
DIA [1.3K]

Answer:

It is any information that is audio or video but not text.

Explanation:

5 0
2 years ago
A user calls your help desk and says that he is trying to configure his Word document so that the text within his paragraphs is
katrin [286]

Answer:

The best answer would be

Explanation:

To access this command ...

Select the Format tab - Properties - Paragraph properties - Bleeds and spaces

7 0
3 years ago
Other questions:
  • In which area of engineering does material selection play a vital role a design optimization b forensic engineering c mechanical
    6·1 answer
  • Select the correct answer. Which sentence best describe an effective management strategy? A. Conceal game-related clippings prio
    12·2 answers
  • Which of the following is a list of input devices?
    13·2 answers
  • Which of the following is an unintended consequence of pesticide use on crops?
    10·1 answer
  • Help, please!! A file named "games.txt" exists and has 80 lines of data. You open the file with the following line of code. aFil
    6·1 answer
  • What do I need to write ??
    14·1 answer
  • If you use the assign software to a user option, how does the new software install to the user's computer? 70-411
    10·1 answer
  • What is the difference between KE an PE
    8·1 answer
  • The ratio of sparrows to bluejays at the bird sanctuary was 5 to 3 If there were 15 bluejays in the sanctuary, how many sparrows
    12·1 answer
  • Over the last decade, the overall energy consumption of cloud data centers worldwide has remained relatively the same. Why is th
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!