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
7nadin3 [17]
3 years ago
8

Question 2: Sum of consecutive odd View Past Answers No past answers. Write a program which asks user to enter an integer n, cal

culates the total sum of the consecutive ODD integers from 1 to n (inclusive of n if n is odd) and store in the variable called sum calculates the average value of the consecutive ODD integers from 1 to n and store in the variable called average prints the value of sum and average For example if n = 7, the program will compute 1+3+5+7, sum = 16, average = 4 if n = 6, the program will compute 1+3+5, sum = 9, average = 3
Pls help ya thx(btw this is python)
Computers and Technology
2 answers:
Vikentia [17]3 years ago
6 0

Answer:

number = int(input("Enter number ") )

sum = 0

count = 0

for x in range(1, number+1, 2):

 sum += x

 count += 1

average = sum/count

print("sum = %d"% sum)

print("average = %d"% average)

The range() function conveniently lets you enumerate all odd values from 1 to your number.

svp [43]3 years ago
4 0
Answer:

Step-by-step Explanation:
You might be interested in
Which is a challenge in photographing forests
Murljashka [212]
Getting the right angle, making sure their is detail in the image

8 0
4 years ago
Read 2 more answers
Henry conducted a survey on an ad done by his company. In the survey, he asked people to evaluate the ad and state whether they
Llana [10]
The answer is (C) Rating scale test

These are set of categories designed to get a response from set information about a qualitative or a quantitative attribute. Common examples include a 1-10 rating scale or the Likert response scale. One is required to select a number or an option considered to reflect the perceived quality of something, say a product.






4 0
4 years ago
The declarations and statements that compose the method definition are called the __________.
Fiesta28 [93]

Answer:

a. method body.

Explanation:

A method contains the following components:

  • method name
  • method arguments
  • method return type
  • method implementation code

All of these together constitute the method body. The method body contains the declarations and statements constituting the method definition.

Apart from this, when the method is invoked at runtime, it needs to be called with method-name and the actual parameter list which gets substituted for the formal parameters in the method body.

8 0
3 years ago
Your office printer was working earlier in the day but is no longer printing any documents. Pre-existing workstations are manual
VARVARA [1.3K]

Answer:

I think it is either A or B

Explanation:

3 0
3 years ago
Is this a scam pls tell me????????????/
zloy xaker [14]

Yes don't trust at all, I've got that so many times

3 0
4 years ago
Read 2 more answers
Other questions:
  • The IBM 370 mainframe computer was introduced in 1970. The 370 Model 145 could hold up to 524,288 bytes of data (512 Kbytes). It
    8·1 answer
  • The keys in the computer's keyboard are represented by a numeric code agreement (ASCII). For example A is 65 and a is 97.
    12·1 answer
  • What is an appropriate action when an email thread becomes long?
    6·1 answer
  • The answer is D!!Readable code includes
    9·2 answers
  • 1. Text that is located between and appears in the browser's
    13·1 answer
  • Need help plz with the code
    12·1 answer
  • Select the correct answer.
    7·2 answers
  • After inserting a video into your slide how can you test it
    11·1 answer
  • When an AC voltage is being measured
    15·1 answer
  • Write a program in C++ to Find the Average of the sum of prime numbers between 1 to any given number
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!