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
Nadusha1986 [10]
3 years ago
6

Implement the function:

Computers and Technology
1 answer:
Sloan [31]3 years ago
3 0

Answer:

This is written in C++

Check comments for explanations

Program starts here

#include<iostream>

#include<string>

using namespace std;

//The function get_ap_terms begins here

string get_ap_terms(int a, int d, int size_tn)

{  

// This line initializes the expected string to empty string

string result = "";

//The for iteration loops through the number of terms the function is expected to return

for(int i = 1; i<= size_tn;i++)

{

//This line checks if the loop is less than the number of  terms    

if(i < size_tn)

  {

//This string gets the current term of the progression

   result+=to_string(a)+ ", ";

//This line calculates the next term

   a+=d;  

  }

  else

  {

//This line calculates the last term

   result+=to_string(a);

  }

}

//This line returns the string containing the first n terms of the arithmetic progression

return result;

}

//The main function starts here

int main()

{

//This line declares the first term (a), the common difference (d) and the number of terms (size_tn)

int a,d,size_tn;

//This line prompts the user for the first term

cout<<"First Term: ";

//This line gets the first term

cin>>a;

//This line prompts the user for the common difference

cout<<"Common Difference: ";

//This line gets the common difference

cin>>d;

//This line prompts the user for number of terms

cout<<"Number of Terms: ";

//This line gets the number of terms

cin>>size_tn;

//This line calls the function to print the string containing the first n terms

cout<<get_ap_terms(a, d, size_tn);

return 0;

}

//Program ends here

You might be interested in
What mobile operating system below requires all applications to be reviewed and approved before they can be made available in th
FinnZ [79.3K]

Answer:

The correct answer to the following answer will be iOS.

Explanation:

The iOS formerly stands for iPhone Operating System, basically is a mobile operating system developed by Apple Inc. This edition mainly supports Apple devices such as iPhone, iPod touch, iPad, etc.

Just because of this iOS gives the improvement to the entire application and is one of the operating systems which requires all that applications to be approved before showing availability in the App stores.

So, iOS is the right answer.

4 0
3 years ago
I dunno what to write my memo thing about ⁻³⁻
Alex73 [517]

Answer:

Wdym? I could help u

Explanation:

5 0
3 years ago
Read 2 more answers
compared to other data structures, this dbms structure is more flexible and stores data as well as instructions to manipulate th
Nuetrik [128]

Object-oriented databases is more flexible and stores data as well as instructions to manipulate the data.

A system known as an object database uses object-oriented programming to represent data in the form of objects. Different from relational databases, which are table-oriented, are object-oriented databases.

The concept of object-oriented programming languages, which is currently popular, is the foundation of the object-oriented data model. Overloading, polymorphism, and inheritance Object-oriented programming fundamentals that have found use in data modelling include object-identity, encapsulation, and information hiding with methods to provide an interface to objects. The rich type system, which includes collection and structured types, is supported by the object-oriented data model as well.

In contrast to relational databases, which can only handle one type of data, object databases can handle multiple data types. Unlike conventional databases like hierarchical, network, or relational, object-oriented databases can handle a variety of data types, including text, numbers, images, voice, and video.

Also, Reusable code, realistic modelling, and increased dependability and flexibility are all provided by object-oriented databases.

To learn more about Object-oriented databases click here:

brainly.com/question/29441658

#SPJ4

7 0
1 year ago
How to boost audio live ​
Masteriza [31]
Huh


Hzhanajsjjajajans
6 0
3 years ago
How to work a computer cause i don't know how to
VladimirAG [237]

Answer:

power on, connect to internet, download games

6 0
3 years ago
Other questions:
  • Rose has a list of two columns of information separated by tabs. She wants to input this information into a table. What is the f
    15·2 answers
  • in what way do rules and laws created to address public problems affect individuals groups and business
    13·1 answer
  • Which of the following actions might contribute to recommendations you see online?
    6·1 answer
  • Write a program that asks the user to input
    11·1 answer
  • It is important to name your files in a variety of formats. true or false
    15·2 answers
  • Some of the users in your company create and delete so many files that they have problems with fragmented disks. Which of the fo
    5·1 answer
  • Which symbol is at the beginning and end of a multiline comment block? &amp;&amp;&amp; """ %%% ###
    5·1 answer
  • Check ALL of the correct answers.
    13·1 answer
  • For each of the descriptions below, perform the following tasks:
    11·1 answer
  • What makes a source credible?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!