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).

Answers

Answer 1

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

for i in range(ind):

   numday+=daymonths[i]

This adds the day number to the sum of the months

numday+=day

This prints  the required number of days

print(numday)    

Note that: Error checking is not done in this program


Related Questions

For this exercise, you are going to complete the printScope() method in the Scope class. Then you will create a Scope object in the ScopeTester and call the printScope.
The method will print the name of each variable in the Scope class, as well as its corresponding value. There are 5 total variables in the Scope class, some of which can be accessed directly as instance variable, others of which need to be accessed via their getter methods.
For any variable that can be accessed directly, use the variable name. Otherwise, use the getter method.
Sample Output:
The output of the printScope method should look like this:
a = 5
b = 10
c = 15
d = 20
e = 25
public class ScopeTester
{
public static void main(String[] args)
{
// Start here!
}
}
public class Scope
{
private int a;
private int b;
private int c;
public Scope(){
a = 5;
b = 10;
c = 15;
}
public void printScope(){
//Start here
}
public int getA() {
return a;
}
public int getB() {
return b;
}
public int getC() {
return c;
}
public int getD(){
int d = a + c;
return d;
}
public int getE() {
int e = b + c;
return e;
}
}

Answers

Answer:

Explanation:

The following is the entire running Java code for the requested program with the requested changes. This code runs perfectly without errors and outputs the exact Sample Output that is in the question...

public class ScopeTester

{

public static void main(String[] args)

{

       Scope scope = new Scope();

       scope.printScope();

}

}

public class Scope

{

private int a;

private int b;

private int c;

public Scope(){

a = 5;

b = 10;

c = 15;

}

public void printScope(){

       System.out.println("a = " + a);

       System.out.println("b = " + b);

       System.out.println("c = " + c);

       System.out.println("d = " + getD());

       System.out.println("e = " + getE());

}

public int getA() {

return a;

}

public int getB() {

return b;

}

public int getC() {

return c;

}

public int getD(){

int d = a + c;

return d;

}

public int getE() {

int e = b + c;

return e;

}

}

User ideas for ro blox? I prefer no numbers or underscores.

Answers

do what the other person said

how to learn python ?

Answers

Answer:

See below.

Explanation:

To learn python programming language, first, you have to know the basic. Surely, you may recognize this function namely print()

print(“Hello, World!”) — output as Hello, World!

First, start with familiarizing yourself with basic function such as print. Then step up with arithmetic and declare or assign variable then list.

Here are example of functions:

1.) print(argument) — If argument is a string (word-typed), make sure to use “” or ‘’ or else it’ll output an error and say the argument is not defined.

print(“Hi, Brainly”) will output Hi, Brainly

print(2+3) will output 5

Numerical data or numbers do not necessarily require “ “ or ‘ ‘

print(3+3) will output 6 but print(“3+3”) will output 3+3 which is now a string.

2.) type(argument) - this tells you which data/argument it is. There are

< class ‘str’ > which is string, meaning it contains “ “ or ‘ ‘< class ‘int’ > which is integer< class ‘float’ > which is decimal (20.0 is also considered as float, basically anything that contains decimal is all float type)< class ‘list’ > which is a list. List is something that contains elements within square brackets [ ]

etc.

Make sure you also do print(type(argument)) as well so it will print out the output.

3.) Arithmetic

+ is addition

Ex. print(1+3) will output 4

   2. - is subtraction

Ex. print(5-4) will output 1

   3. * is multiply

Ex. print(4*5) will output 20

   4. ** is exponent

Ex. print(5**2) will output 25

   5. / is division

Ex. print(6/3) will output 2 — sometimes will output the float type 2.0

   6. % is modulo or remainder

Ex. print(7%2) will output 1

4.) Variables

To assign a variable, use =

An example is:

x = 2

y = 5

print(x+y) will output 7

print(type(x)) will output the < class ‘int’ >

These are examples of what you’ll learn in basic of python - remember, programming depends on experience and always focus on it. Keep practicing and searching will improve your skill at python.

Computers were originally invented to
Group of answer choices
A.to share information on the Internet.

B.make complex mathematical calculations possible and make tasks easier for humans.

C.to play video games.

Answers

Answer:

B

Explanation:

It's B because why would it me made to play video games

Answer:

B

Explanation:

A, the internet didnt exist yet, so it cant be this

C, video games would require computers, so its ruled out on a similar basis as the previous

Why would an organization need to be aware of the responsibilities of hosting

personal data in its platforms?

Answers

Answer:

Providing transparent services for platform customers. Following data protection regulations to avoid disruptions from lack of compliance.

Assume in the for loop header, the range function has the three arguments: range (1, 10, 3), if you were to print out the value of the variable
in the for loop header, what will be printed out? List the values and separate them with a comma.

Answers

Answer:

1, 4, 7

Explanation:

The instruction in the question can be represented as:

for i in range(1,10,3):

   print i

What the above code does is that:

It starts printing the value of i from 1

Increment by 3

Then stop printing at 9 (i.e.. 10 - 1)

So: The sequence is as follows

Print 1

Add 3, to give 4

Print 4

Add 3, to give 7

Print 7

Add 3, to give 10 (10 > 10 - 1).

So, it stops execution.

Other Questions
Please let me know asap The mean monthly water bill for 44 residents of the local apartment complex is $104. What is the best point estimate for the mean monthly water bill for all residents of the local apartment complex? Brainliest for correct answer :)) True/False7. Advertisements simply mirror, rather than shape, consumer preferences and values.8. "Helps," "fights," and "up to" are common weasel words.9. Ads that play on our fears and insecurities are known as anxiety ads.10. Feel-good ads are used to appeal to certain images people have of themselves (as competent or responsible, for example).11. The news media tend to extract information from the wider context, leaving us with some facts but little knowledge. URGENT HELP PLZ ILL GIVE BRAINLIEST!!! The value of the function f(x) is 600 when x=0 and decreases by 9% for every one-unit increase in x. Complete the equation that represents the function f(x)its a open answer please help Please hurryy please help its not b pls help, if you can Which sentence does NOT use a colon correctly? A. Warning: This bridge is slippery when wet. B. To make a simple bean dip, mix refried beans with: salsa, spices, and chopped onion. C. The time of Mr. Parks drawing class has been changed from 3:00 to 3:30. Joe buys 6 adult tickets and 4 child tickets for the movies. Each adult ticket cost $9. Each child ticket cost the same amount. Joe pays with a $100 bill and gets $22 in change. How much does each child ticket cost? Choose Yes or No to tell whether the symbol will be reversed when the variable is isolated in each inequality. 10.5 < 3ab/6 74.5c > 921/5 5/2dPlease I need this answer right away!!! 3. Marie n'pas cours demain.a. ab. ontC. asd. avons Type a sentence with the following parts of speech in the order they are given. 3. NOUN CONJUNCTION PRONOUN VERB CONJUNCTION VERB PREPOSITION ARTICLE NOUN. INTERJECTION i need help with dis math CTSOs teach and encourage students to pursue a career in varied fields. Choose the correct CTSO for the students. Students who wish to pursue a career in the field of education, should enroll in (blank A), while students who aspire to do something in business, should opt for (Blank B) . Blank A- 1. FEA 2.FBLA 3. FFA Blank B- 1. HOSA 2. DECA 3. FBLA A floor tile is shaped like a regular hexagon. The side lengths are 4 cm and the apothem 23 cm.What is the area of the hexagonal floor tile?Enter your answer as a decimal to the nearest hundredth.area = cm2 The owners of Whitewater rafting are currently contemplating a manufacturing process (Old Process) that will require an investment of $4,000 and a variable cost of $6 per raft vs. a larger (New Process) initial investment of $20,000 with more automated equipment that would reduce their variable cost of manufacture to $2 per raft. Compare the two manufacturing processes proposed here. For what volume demand should each process be chosen? A. From 0 to 1000 choose Old Process, From 1000 to infinity choose New Process B. From 0 to 4000 choose New Process, From 4000 to infinity choose Old Process C. From 0 to 4000 choose Old Process, From 4000 to infinity choose New Process D. Always use the Old Process and never use the New Process E Always use the New Process and never use the Old Process HELP HAVING A BAD DAYRoger can finish his math homework in 6 hours. Trish can finish the same homework in 5 hours. What part of the homework will Roger and Trish finish if they work together for x hours?I WILL REWARD BRAINLIEST FOR THE CORRECT ANSWER What kind of fraction will you have when the percent is over 100% Memos and EmailsEmailOk so here's the thing: 90% of the emails I get from students look like texts. When I was a grant writer, if I sent an email like that, I would have been in my boss's office so fast. SO let's learn proper etiquette for sending emails. 1) Start with a salutation. Hello, Hi, Dear _____, Hi _______, Greetings! any of these work. Make sure your initial email has these. If you don't know the person personally, use Mr., Mrs., Ms., or the new Mx. and their last name. 2) Body: The body has to be right to the point and formal. Most work emails are all business. You can say something like "I hope your Monday is going well!" but beyond that, get to the point. 3) End it well. Best is a good way to go if you don't know the person. Sincerely is good too. It's all personal preference. Just make sure you end it. Also, ALWAYS include your last name. I get so many emails that say "Jackie" or whatever short name people go with, and I have 5 classes. Let's do some math here. Your job is to create an email that you, as the CEO, are sending to one or more of your staff. One is preferable. Set up an issue you wish to address with that person (I really don't care what it is). Make it at least 100 words. Memo An intra-office memo is very important for giving widespread information to your employees. For this piece, you will create a big problem that your employees created, and then send them a memo explaining how you fixed it and how to prevent it from happening again. Use your imagination. Play with this. Make it funny. I want to laughCan someone give me an example