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
topjm [15]
2 years ago
14

Write a function named firstLast2 that takes as input an array of integers and an integer that specifies how many entries are in

the array. The function should return true if the array starts or ends with the digit 2. Otherwise it should return false. Test your function with arrays of different length and with the digit 2 at the beginning of the array, end of the array, middle of the array, and missing from the array.
Computers and Technology
1 answer:
frosja888 [35]2 years ago
4 0

Answer:

<em>Written in C++</em>

#include<iostream>

using namespace std;

int firstLast2(int arr[], int n);

int main()

{

int n;

cout<<"Number of Elements: ";

cin>>n;  

int myarray[n];

for(int i = 0; i<n;i++) {

cin>>myarray[i];

}

firstLast2(myarray, n);

return 0;

}

int firstLast2(int arr[], int n){

if(arr[0] == 2 || arr[n - 1] == 2) {

 cout<<"True";

}

else {

cout<<"False";

}

}

Explanation:

<em>I've added the full source code as an attachment where I used comments to explain difficult lines</em>

Download cpp
You might be interested in
Can someone give me the code for the edhesive 3.7 code practice for python? Thanks.
belka [17]

Answer:

Its me I think u might be able to know :)

Explanation:

4 0
2 years ago
You have a sales chart and excel that you want to include in a 3rd quarter report to include in a 3rd quarter report quit it in
Nataliya [291]

Answer:

The paste function to use is the Advanced Paste Function that reads Use Destination Theme and Link Data or Keep Source Formatting and Link Data.

Explanation:

The first function adopts the Theme (such as colors, fonts, and other formatting) whilst retaining links to the data in the excel workbook. The latter imports the formatting or theme as-is from excel.

In both scenarios, (for as long as both documents are open and are in the same file) when the data in excel is opened and updated, it reflects automatically in the chart on the Microsoft Word document.

Cheers

5 0
2 years ago
listen to exam instructions a small business called widgets, inc. has hired you to evaluate their wireless network security prac
Alex

Following actions could you most likely advise the client taking to strengthen the security of their wireless network-

  • Change the default SSID to anything different.
  • Turn off SSID broadcasting.
<h3>Explain the term wireless network security?</h3>
  • Designing, putting into practice, and ensuring security on such a wireless computer network are all parts of wireless network security.
  • A wireless computer network is further protected by this subset of network security.
  • Wireless security is another name for wireless network security.

For the stated question-

  • Disabling SSID broadcast and changing the network name are advised.
  • By disabling SSID, the network name won't be displayed on devices looking for a network can connect to, and so by changing the name, it will be impossible for anyone who already knows the old name to connect.
  • Both of which significantly boost security.

To know more about the wireless network security, here

brainly.com/question/28257213

#SPJ4

3 0
1 year ago
System requirements that are important in determining if a software program will work on a computer are ____.
EastWind [94]
The RAM, System Storage ,CPU or GPU and Operating System.
5 0
3 years ago
How do i choose a most brainlyist
GuDViN [60]

Answer:

They’ll have to be 2 answers first, when 2 answers are given, you can choose which is branlyis. If there are no 2 answers, you can’t choose.

8 0
3 years ago
Read 2 more answers
Other questions:
  • What is not an option when a user is exporting contacts to share with others?
    10·1 answer
  • The operating system’s application programming interface (API) provides software developers with tools they use to build applica
    5·1 answer
  • ____________ is used by IM and other applications that provide voice services over lower-speed digital circuits.
    15·1 answer
  • What would be the best thing you could do to prepare yourself to work for a company that has embraced globalization. A) learn ho
    12·2 answers
  • Which file system is designed to verify and autocorrect data faults on the volume without having to bring the volume down for ma
    11·1 answer
  • Write a brief, two-page paper describing how your lifestyle and values impact your use of the Web for e-commerce. How is your on
    15·1 answer
  • Write a Java program to create a class called Cars. The class should include three instance variables: makes (type: String), mod
    12·1 answer
  • Place the steps for attaching a file to a message in order from top to bottom.
    12·1 answer
  • Difference between multi-national and global company​
    11·2 answers
  • this feature offered by mutual funds allows investors to switch from one mutual fund to another within a fund families.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!