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
Dafna11 [192]
2 years ago
5

Write a program to construct the first 15 terms of a geometric sequence with initial term 4 and a common ratio 1/2. The output s

hould be a python list and the number should be rounded to 5 digits after the decimal places.
Computers and Technology
1 answer:
solniwko [45]2 years ago
5 0

The program to construct the first 15 terms of a geometric sequence with initial term 4 and a common ratio 1/2 is as follows:

def geometric(a, r):

    list_of_terms = [a]

    length = 0

    n = 2

    while length < 14:

         x = round(a*pow(r, n-1), 5)

         length += 1

         n += 1

         list_of_terms.append(x)

    return list_of_terms

print(geometric(4, 0.5))

<h3 /><h3>Code explanation</h3>

The code is written in python.

  • we defined a function named geometric. The function accept two parameters as a(first term) and r(common ratio).
  • we declared a variable "list_of_terms" and store the first term in it.
  • Then we initialise length to zero
  • The number of term start from 2.
  • While the length variable is less than 14, we use the geometric formula to find the terms by increasing the value of n in the loop.
  • We append the terms to list_of_terms.
  • Then return the list_of_terms.
  • Finally, we call the function with the parameters.

learn more on python here: brainly.com/question/26949234

You might be interested in
Identify the correct XHTML syntax for inserting an image as a hyperlink from the options provided. A. book.gif B. C. D.
mariarad [96]

Answer:

The Correct syntax for inserting an image as hyperlink is given in explanation section

Explanation:

To make an image act as a hyperlink, place the image element within the HTML anchor "<a></a>"  element.

The syntax of inserting image hyperlink in XHTML is given below.

<a href = "link_that_can_be_accessible"><img src="source of image" alt="display name if image not shown in the browser" border="0"/></a>

for example lets insert image as hyperlink

<a href="ajax.html"><img src="logo.gif" alt="AJAX" border="0" /></a>

The default appearance is a blue border around the image. Specifying border="0" removes the border around the image.

if you want to insert image from another folder then the image hyperlink looks like this:

<a href="ajax.html"><img src="/images/html5/logo.gif" alt="AJAX" border="0" /></a>

If you want to insert image from another server then image hyper link looks like this:

<a href="ajax.html"><img src="https://www.myExample.com/images/html5/logo.gif" alt="AJAX" border="0" /></a>

4 0
4 years ago
50 ) What is the cell address of 4th row and 4th column? A) 4D B) E4 оооо C) 04 D) B4​
blsea [12.9K]

Answer:

The cell address of 4th row and 4th column is

4D/D4

7 0
3 years ago
"what is the name of the ipsec configuration file"
kifflom [539]
Ipsec.conf file. This file is found in the /etc/ directory
5 0
4 years ago
Implementations <br> in c++ programming when finding lcm and gcd in c++​
vazorg [7]

Answer:

#include<iostream>

using namespace std;

int lcm(int m, int n) {

  int a;

  a = (m > n) ? m: n;

  while (true) {

     if (a % m == 0 && a % n == 0)

        return a;

        ++a;

  }

}

int gcd(int m, int n) {

  int r = 0, a, b;

  a = (m > n) ? m : n;

  b = (m < n) ? m : n;

  r = b;

  while (a % b != 0) {

     r = a % b;

     a = b;

     b = r;

  }

  return r;

}

int main(int argc, char **argv) {

  cout << "Enter the two numbers: ";

  int m, n;

  cin >> m >> n;

  cout << "The LCM of two numbers is: " << lcm(m, n) << endl;

  cout << "The GCD of two numbers is: " << gcd(m, n) << endl;  

  return 0;

}

Explanation:

7 0
3 years ago
How many mb are in a gb?
frosja888 [35]

Answer:

1000 megabytes are in a gigabyte

Explanation:

3 0
3 years ago
Other questions:
  • The _________ element enables developers to embed a self-contained web page within another html document.
    12·1 answer
  • A forensics workstation consisting of a laptop computer with almost as many bays and peripherals as a stationary workstation is
    10·1 answer
  • In addition to the four primary computer operations, today's computers almost always perform ____ functions.
    7·1 answer
  • An
    9·1 answer
  • You Could Never Size Me UP! Been Doing This Sh*t A Long ⏱time
    15·1 answer
  • Some one help pls will mark brainless !!!!!
    13·1 answer
  • A class is a type of object that defines the format of the object and the actions it can perform. True False
    14·1 answer
  • How are most databases organized?
    15·1 answer
  • Your friend says, “I can’t ever watch a streaming movie without it pausing for long moments. It makes me crazy!” What might you
    11·1 answer
  • which responses would you use for a computer or electronic medical record outage? (select all that apply)
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!