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]
4 years ago
6

Implement the function:

Computers and Technology
1 answer:
Sloan [31]4 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
. A wireless ……..is a device used to resolvewireless network connectivity problems.
Setler [38]

Answer:LAN adapter

Explanation:

LAN adapter is use to connect a computer to the network in an local area network. The connection is possible via a modem or a router which helps to reduce the wireless connectivity problem.

4 0
3 years ago
true or false? the email body copy, the body design/layout, the body images, the cta, and the email signature are all elements t
Kisachek [45]

False: Elements that can effect your email's open rate include the email body copy, the body design/layout, the body images, the cta, and the email signature.

Understanding why you are sending the email, your purpose, and the value you are providing to the recipient are three essential components of sending the perfect email.

When an email is successfully delivered to the receiving server, it is said to have been delivered. When an email successfully reaches a recipient's inbox, it is said to have been delivered. It is possible to have strong email delivery but poor deliverability if the recipient's spam folder received the message instead of their inbox.

You must comprehend your audience's interests, problems, patterns of behavior, reasons for doing things, and objectives. For each audience, develop unique buyer personas. Knowing more about your audience will help you make sure.

To know more about email click here:

brainly.com/question/14666241

#SPJ4

6 0
2 years ago
Which type of game controller has a set of controls for each hand?
svet-max [94.6K]
If you play the Wii, they have the controller and then they have a nunchuck that connects to the other controller, and you use that with your other hand. Hope that helps :)
6 0
3 years ago
Hymter. Wants to workin The Energy career field with electrical energy
m_a_m_a [10]

Answer: what is the question

Explanation:

3 0
3 years ago
Continuing with the carpet example, you devise a set of steps, or a(n) , to solve the problem. You then use a programming langua
Orlov [11]

Answer:

i) an instruction set, ii) pseudocode

And program in python is:

LENGTH=input("ENTER THE LENGTH OF THE ROOM IN FEET")

BREATH=input("ENTER THE  BREATH OF THE ROOM IN FEET")

AREA=int(LENGTH) * int(BREATH)

print("THE AREA OF THE ROOM IN SQUARE YARDS IS", AREA/9)

print("THE CARPET REQUIRED IN SQUARE FEET",AREA)

Explanation:

The pseudo code is:

START

ENTER THE LENGTH OF THE ROOM IN FEET; LENGTH

ENTER THE BREATH OF THE ROOM IN FEET; BREATH

PRINT THE AREA OF THE ROOM IN SQUARE FEET IS; AREA

PRINT THE AREA OF THE ROOM IN SQUARE YARDS IS; AREA/9

PRINT THE CARPET REQUIRED IN SQUARE FEET; AREA

STOP

6 0
3 years ago
Other questions:
  • What does dram stand for?
    5·2 answers
  • Write a program that reads a floating-point number from the user and prints "zero", "positive" or "negative"
    13·1 answer
  • The theft and/or destruction of information, resources, or funds via computers, computer networks, or the internet:
    5·1 answer
  • If you want to change the color of cell which button you click
    8·1 answer
  • One part of a development team has completed an algorithm. Why is it important to share it with others on the team? Choose all t
    15·1 answer
  • Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input
    5·1 answer
  • What facilitates the automation and management of business processes and controls the movement of work through the business proc
    9·1 answer
  • In object-oriented analysis, an object is a member of a(n) _____, which is a collection of similar objects.
    11·1 answer
  • What is a saved link to a particular web page?​
    7·1 answer
  • explain how principles of computational thinking skills are applied in finding solutions that can be interpreted into software a
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!