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
As time goes on, technology is likely to _______. A. Increase in complexity b. Decrease in complexity c. Stay at the same comple
amid [387]

Answer:

The answer to this question is the option "A".

Explanation:

In this question, the answer is Increase in complexity because, In computer science, the computerized or simply complexity is an algorithm. In this algorithm, the number of the resource is required for moving it (a quality separate to “complexity” in a conventional reason). So in this question the answer is option A that is  Increase in complexity.

5 0
3 years ago
Which relation is created with the primary key associated with the relationship or associative entity, plus any non-key attribut
konstantin123 [22]

Answer:

- Transform binary or unary M:N relationship or associative entity with its own key.

Explanation:

Transform binary relation is described as the method through which a decimal can easily be converted into binary while the unary relationship is described as a relationship in which both the two participants occurs from the same entity.

In the given case, 'transform binary or unary M:N relationship' can be created using 'the primary key linked with the relationship plus any non-key aspects of the relationship and the primary keys of the related entities' as it displays the existence of a relationship between the occurrences of a similar set of the entity i.e. associative entity here.

5 0
3 years ago
How has technology fragmented the audience for sports and entertainment<br> commodities?
PSYCHO15rus [73]

Technology has indeed made to audience of sports and entertainment increase rapidly.

Explanation:

Years passed, one will have to go to a sports stadium or an event center before he/she can access sports or entertainment.

But in recent years the introduction of internet has made every person who wishes to, to enjoy entertainment or sports in the comfort of his/her home or wherever he/she may find him/her self.

It has even given the opportunity for those who are not able to make time as and when the event is going on to watch or listen to it later.

The internet is one of the powerful tools that help individuals enjoy entertainment and sports across the world.

The invention of television and radio has also increased the ability for a sportsman or an entertainer to get more fans in just a short period of time.

4 0
3 years ago
When parking ur vehicle facing downhill with a curb, you should point ur front wheels?
Genrish500 [490]
Wheels should be pointing towards the curb. this is in case your vehicle rolls, if it does, the wheel will hit the curb and stop the car, it will also prevent the car from going into the road and incoming traffic. vice versa when parking uphill, point wheels away from curb, that is also to prevent the car from rolling to incoming traffic.
6 0
3 years ago
Read 2 more answers
Create an array of 10 fortune cookie sayings that will be randomly displayed each time the user reloads the page. The fortune wi
vfiekz [6]

Answer:

let cookieNumber = Math.floor(Math.random() * 10)

switch (cookieNumber) {

  case 1:

   document.write('Fortune 1')

   break;

  case 2:

   document.write('Fortune 2')

   break;

   case 3:

   document.write('Fortune 3')

   break;

  case 4:

   document.write('Fortune 4')

   break;

  case 5:

   document.write('Fortune 5')

   break;

  case 6:

   document.write('Fortune 6')

   break;

  case 7:

   document.write('Fortune 7')

   break;

  case 8:

   document.write('Fortune 8')

   break;

  case 9:

   document.write('Fortune 9')

   break;

  case 10:

   document.write('Fortune 10')

Explanation:

The cookieNumber is generated using Math.random(), which is rounded to a whole number using Math.floor(). Then, a switch block is used to display a different fortune depending on the value of cookieNumber.

4 0
3 years ago
Other questions:
  • Which change signaled a musical progression toward rock and roll?
    14·1 answer
  • Write a program that loops one thousand times. add all the even numbers and display the results. add all the odd numbers and dis
    13·1 answer
  • Hard drives are usually self-contained, sealed devices. Why must the case for the hard drive remain sealed closed?
    8·1 answer
  • 2
    11·1 answer
  • You are comparing cryptographic solutions to implement at your organization. Which two items should you focus on when you are ev
    12·1 answer
  • Question 3
    13·1 answer
  • How does calculate() work?
    6·2 answers
  • What is the code for this please?​
    13·1 answer
  • Write a program that gets three input characters which are user's initials and displays them in a welcoming message. Then gets i
    12·1 answer
  • b. Write a complete program for the following situation related to setting the speed of a car to preset values before starting a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!