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
vova2212 [387]
3 years ago
12

3. Write a function named sum_of_squares_until that takes one integer as its argument. I will call the argument no_more_than. Th

e function will add up the squares of consecutive integers starting with 1 and stopping when adding one more would make the total go over the no_more_than number provided. The function will RETURN the sum of the squares of those first n integers so long as that sum is less than the limit given by the argument
Computers and Technology
1 answer:
kenny6666 [7]3 years ago
6 0

Answer:

Following are the program to this question:

def sum_of_squares(no_more_than):#defining a method sum_of_squares that accepts a variable

   i = 1#defining integer variable  

   t = 0#defining integer variable

   while(t+i**2 <= no_more_than):#defining a while loop that checks t+i square value less than equal to parameter value  

       t= t+ i**2#use t variable to add value

       i += 1#increment the value of i by 1

   return t#return t variable value

print(sum_of_squares(12))#defining print method to call sum_of_squares method and print its return value

Output:

5

Explanation:

In the program code, a method "sum_of_squares" is declared, which accepts an integer variable "no_more_than" in its parameter, inside the method, two integer variable "i and t" are declared, in which "i" hold a value 1, and "t" hold a value that is 0.

In the next step, a while loop has defined, that square and add integer value and check its value less than equal to the parameter value, in the loop it checks the value and returns t variable value.

You might be interested in
Events and conditions that happen within an organization that are somewhat easier to deal with when responding to change are cal
IgorC [24]
These are called abstractions. They can be created by functions, if statements, or on event structures.
3 0
3 years ago
____ is an easy way to invitation through a web page​
Agata [3.3K]

Answer:

RSVP?

Explanation:

6 0
3 years ago
Read 2 more answers
Which option is not a tab type? center tab right tab hanging tab left tab
Gala2k [10]

Answer: C

Explanation:

6 0
3 years ago
Read 2 more answers
Give the appropriate term for each of the following.1. An easy-to-remember address for calling a web page (like www.code.org). 2
Nimfa-mama [501]

Answer:

1. URL (Universal Resource Locator)

2. DNS (Domain Name System)

3. Network

4. Packets

5. The Internet Engineering Task Force (IETF)

6. Bit

7. HTTP (Hypertext Transfer Protocol)

8. Protocol

Explanation:

1. "URL is the address of a World Wide Web page."

2. "DNS: The service that translates URLs to IP addresses. IP Address: A number assigned to any item that is connected to the Internet."

3. "A network is defined as a group of two or more computer systems linked together."

4. "In Information technology, a packet is collection of data that can be used by computers which need to communicate with each other, usually as part of a network."

5. "The Internet Engineering Task Force is an open standards organization, which develops and promotes voluntary Internet standards, in particular the standards that comprise the Internet protocol suite."

6. "A bit (short for binary digit) is the smallest unit of data in a computer. A bit has a single binary value, either 0 or 1"

7. "Hypertext Transfer Protocol provides a network protocol standard that web browsers and servers use to communicate."

8. "A network protocol defines rules and conventions for communication between network devices. Network protocols include mechanisms for devices to identify and make connections with each other, as well as formatting rules that specify how data is packaged into sent and received messages."

Hope this helps! <3

4 0
4 years ago
A programmer must add 1 to the value stored in the int variable sum. One way is given to get you started. Write two more distinc
olganol [36]

Answer:

option 1: sum++

option 2: ++sum

Explanation:

In programming, a variable a container or memory location assigned to a value. The C++ syntax specifies the memory location type of value on the declaration. The major types of variables in C++ are; integer, float, double, char, string, and boolean.

To add 1 to an integer variable, the variable value could be summed with one and assigned to that same variable or '++before' and 'after++' with adds one to the variable before and after the execution of a statement.

4 0
3 years ago
Other questions:
  • The graphical user interface (GUI) was pioneered in the mid-1970s by researchers at:
    10·2 answers
  • Which of the following is not true about designing classes? In order for class information to be printed instead of a memory add
    12·1 answer
  • Which type of storage disk and disk drive can be used in the given situation? Amy wants to borrow an interesting movie from Bruc
    10·2 answers
  • Joining two or more objects in a publication is known as _____.
    15·2 answers
  • is a shell program in Windows that holds individual utilities called snap-ins, designed for administration and troubleshooting.
    11·1 answer
  • My brainly has broke- XD
    11·1 answer
  • Whenever I rate an answer to a question, it says so and so finds it helpful. It's always the same people that they say find it h
    10·1 answer
  • A file named "games.txt" exists and has 80 lines of data. You open the file with the following line of code.
    7·2 answers
  • List 2 positive impacts of cybersecurity.
    8·2 answers
  • What is the purpose of a computer network needs assessment? to evaluate how to move from the current status to the desired goal
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!