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
Daniel [21]
3 years ago
9

Assume there is a variable, h that has already been assigned a positive integer value. Write the code necessary to compute the s

um of the perfect squares whose value is less than h, starting with 1. (A perfect square is an integer like 9, 16, 25, 36 that is equal to the square of another integer (in this case 3*3, 4*4, 5*5, 6*6 respectively). Assign the sum you compute to the variable q. For example, if h is 19, you would assign 30 to q because the perfect squares (starting with 1) that are less than h are: 1, 4, 9, 16 and 30==1+4+9+16.
Computers and Technology
1 answer:
malfutka [58]3 years ago
3 0

Answer:

import math

h = 19

total = 0

for i in range(1, h):

   if math.sqrt(i) - int(math.sqrt(i)) == 0:

       total += i

print(total)

Explanation:

*The code is in Python.

Initialize the h and total

Create a for loop that iterates from 1 to h. Inside the loop, check if the difference between the square root of a number and the integer part of the square root of that number is equal to 0 (This means the number is a perfect square. For example, if the number is 3, the square root is 1.73 and the integer part of this is 1, the difference is 0.73, not 0. However, if the number is 4, the square root is 2.0 and the integer part is 2, the difference is 0), add that number to the total

When the loop is done, print the total.

You might be interested in
Which format must a document be saved in to share it between two different word processors?. Select one of the options below as
slava [35]
When two different word processors are used to share a document, the word document must be saved in the compatibility format where some of the aspects of one version is retained and reflected in the other version while others cannot be retrieved due to the alteration or absence of a component. 

6 0
3 years ago
Which method(s) must a serializable class, implement?
Cloud [144]

Answer: None of the given option is correct

Explanation:

A serializable class is implemented, when an object is serializable interface. If you want to serialize one of your classes, then the class must implemented in the Serializable interface. To implement the serializable interface, convert a class into the series of bytes and when serializable object might reference your class. Serializable classes are useful when you wanted to persist cases of the class or send them over wire.

5 0
3 years ago
A communication between two devices is over the maximum limit of an ethernet frame size. The Transmission Control Protocol (TCP)
umka2103 [35]

Answer:

D. Sequence number

Explanation:

The sequence number facilitates the keeping track of many segments. This enables it to determine which segments out of many in which it should be in. The sequence number field is usually 32 bits.

Sequence numbers are used in transmitting data because of their importance. Since data is transmitted in packets, they can be lost and as such the receiver uses the sequence numbers to reorder them.

6 0
3 years ago
Equi Technologies offers cloud computing services to several data centers around the world. It hosts services in the cloud, whic
Katena32 [7]

Answer:

The answer is "Software as a service".

Explanation:

The software license strategy permits access to the software via a remote server through subscription-based access to the software. Rather than installing software on each user's PC, SaaS lets them access applications via the Internet.

For a number of reasons, it could save you money. Purchase/installation costs and also ongoing maintenance and upkeep are avoided, which is the primary benefit. SaaS apps may be easily downloaded and managed without breaking the bank on hardware parts and upgrades.

7 0
3 years ago
Who is the president of USA​
myrzilka [38]

Currently it is Donald J. Trump but he is leaving office so it will be Joe Biden :^)

4 0
3 years ago
Read 2 more answers
Other questions:
  • The icons to insert footnotes and endnotes in a document are located in the _____ tab.
    8·1 answer
  • What is a unique text-based Internet address corresponding to a computer's unique numeric IP address called
    14·1 answer
  • I have a problem with Instagram.
    11·1 answer
  • The ________ identifies staff reaction and response times as well as inefficiencies or previously unidentified vulnerabilities.
    5·1 answer
  • A ddr4 dimm with a pc rating of pc4-17000 is running at what speed?
    15·1 answer
  • JAVA
    5·1 answer
  • PLEASE ANSWER THIS ASAP‼️
    10·2 answers
  • Which Windows registry hive stores information about object linking and embedding (OLE) registrations
    11·1 answer
  • When a ____________ file is opened, it appears full-screen, in slideshow mode, rather than in edit mode.
    6·1 answer
  • Typically, hybrid drives use SSD to store the operating system and applications and hard disks to store videos, music, and docum
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!