subject

Python

1) Assume there is a variable , h already associated with a positive integer value. Write the code necessary to count the number of 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 a variable q For example, if h is 19 , you would assign 4 to q because there are perfect squares (starting with 1 ) that are less than h are: 1 , 4 , 9 , 16 .



2) Assume there are two variables , k and m , each already associated with a positive integer value and further assume that k 's value is smaller than m's. Write the code necessary to compute the number of perfect squares between k and m . (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).) Associate the number you compute with the variable q . For example, if k and m had the values 10 and 40 respectively, you would assign 3 to q because between 10 and 40 there are these perfect squares: 16 , 25, and 36 ,.



3) In the following sequence, each number (except the first two) is the sum of the previous two numbers: 0, 1, 1, 2, 3, 5, 8, 13, ... . This sequence is known as the Fibonacci sequence.

We speak of the i'th element of the sequence (starting at 0)-- thus the 0th element is 0, the 1st element is 1, the 2nd element is 1, the 3rd element is 2 and so on. Given the positive integer n , associate the nth value of the fibonacci sequence with the variable result . For example, if n is associated with the value 8 then result would be associated with 21.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. after the loop terminates, it prints out, on a line by itself and separated by spaces, the sum of all the even integers read, the sum of all the odd integers read, a count of the number of even integers read, and a count of the number of odd integers read, all separated by at least one space. declare any variables that are needed. assume the availability of a variable, stdin, that references a scanner object associated with standard input. that is, stdin = new scanner(system.in); is given.
Answers: 3
question
Computers and Technology, 22.06.2019 09:30
My mom and i are moving and we don’t have wifi for the next week, i want to know if using a using a hotspot with unlimited data is better than using regular wifi. i’m considering cost, speed, and data sacrifices.
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
Which of the following statements tests if students have a grade of 70 or above, as well as fewer than five absences? a: if(grade > = 70 and daysabsent < = 5): b: if(grade > = 70 or daysabsent < = 5): c: if(grade > 70 and daysabsent < = 5): d: if(grade > 70 or daysabsent < = 5): i took the test the answer is a
Answers: 1
question
Computers and Technology, 22.06.2019 22:00
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message “constructing”. write a main()function that instantiates one object of the testclass. save the file as testclass.cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array.c . run this program and observe the results.
Answers: 1
You know the right answer?
Python

1) Assume there is a variable , h already associated with a positive integer val...
Questions
question
Mathematics, 14.03.2020 01:28
Questions on the website: 13722360