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
WITCHER [35]
3 years ago
8

Write a function swaparrayends() that swaps the first and last elements of the function's array parameter. ex: sortarray

Computers and Technology
1 answer:
Katena32 [7]3 years ago
3 0
Def swapArrayEnds( array ):
    tmp = array[ len( array ) - 1 ]
    array[ len( array ) - 1 ] = array[ 0 ]
    array[ 0 ] = tmp


You might be interested in
If the decimal number 4 is represented in binary as 100, then what is the binary representation of the decimal number 5?
Allisa [31]
5 is one bigger than 4, so it is 101

Note: this doesn't always work for every number.

the binary numbers 1-8 would be: 1, 10, 11, 100, 101, 110, 111, 1000

Can you guess 9?: 1001

10?: 1010

Hope this helps, <span>and May the Force Be With You!
-Jabba


</span>
8 0
3 years ago
Given ProblemSolution class. Use a pointer to object of "ProblemSolution" class to invoke the "CalculateSum" and "Print" methods
faltersainse [42]

Answer:

#include <iostream>

using namespace std;

class  ProblemSolution {

private:

int num1, num2;

public:

ProblemSolution(int n1, int n2) {

 num1 = n1;

 num2 = n2;

}

int calculateSum() {

 int sum = 0;

 sum = num1 + num2;

 return sum;

}

void printSum() {

 // calculateSum will return sum value that will be printed here

 cout <<"Sum = "<< calculateSum();

}

~ProblemSolution() {

 cout << "\nDestructor is called " << endl;

};

};

int main() {

int a, b;

cout << "Enter a: ";

cin >> a;

cout << "Enter b: ";

cin >> b;

// Initiallizing object pointer of type ProblemSolution

ProblemSolution *objPtr = new ProblemSolution(a,b);

// printing Sum

objPtr->printSum();

// delete objPtr to relaease heap memory :important

delete objPtr;

return 0;

}

Explanation:

we will initialize  a pointer "objPtr" and initallize the constructor by passing 2 values a and b followed by the keyword  "new". the keyword "new" allocates memory in the heap. we can access class member functions using arrow "->". it is important to delete objPtr at the end of the program so that the heap memory can be freed to avoid memory leakage problems.  

3 0
2 years ago
Which of the following is least likely checked by the comprehensive component monitor?
Tcecarenko [31]

Answer:

Least likely checked by the comprehensive component monitor is Opens  

Explanation:

Rationality menas Quality. A quality needs to verified for each and every product that we buy so that it comes life-long and give accurate results all the time.

A short to ground needs to be checked so that it does not gives electrical shock as soon as we touch the component. “Grounding” helps to achieve this.

It is equally necessary  to check for short-to-power so that the power circuit is not damaged due to low-power.

The only irrelevant option is “Opens”.

5 0
3 years ago
As a producer you are willing to supply the most goods at the highest price this is because the highest price earns you the
aleksandrvk [35]

Answer:

most money

Explanation:

common sense

8 0
3 years ago
Royalty free images are those in which the price of the license is determined by the use of the image.
shusha [124]
No they are images that are free to use as long as your not using them to make profit and you give credit to the person who owns the image.
5 0
3 years ago
Read 2 more answers
Other questions:
  • _ includes websites that encourage interaction and connection among people, businesses, and organizations.
    5·1 answer
  • Josie, your best friend, is having a huge Sweet Sixteen party. She has designated you to address all 100 of the envelopes (using
    7·1 answer
  • What is the numerical ratio that is equivalent to 19.2 dB?
    14·1 answer
  • Which technology forms the foundation for cloud computing? forms the foundation for cloud computing.
    12·2 answers
  • What is a seismogram?
    9·1 answer
  • Nina, a programmer, wants to use the programming language Primavera. For which application area should Nina use this language?
    13·2 answers
  • Technician A says that a system should be recharged with refrigerant until the condenser temperature is equal to the ambient tem
    9·1 answer
  • A personal computer (pc) or ____ is a small computer system designed to be used by one person at a time.
    12·1 answer
  • Examine the following output:
    11·1 answer
  • Write one line Linux command that performs the required action in each of the problems given below: (a) Find the difference in t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!