Write a value-returning function that receives an array of integer values and the array size as parameters and returns a count of the number of elements that are less than 60.

Answers

Answer 1

Answer:

The c++ function for reversing an array is given. The function is declared void since it returns no value.

void reverse( int arr[], int len )

{

  int temp[len];

  for( int k = 0; k < len; k++ )

  {

      temp[k] = arr[k];

  }

  for( int k = 0, j = len-1; k < len, j>= 0; k++, j-- )

  {

          arr[k] = temp[j];

   }

}

Explanation:

The reverse function uses another array to reverse the elements of the original array.

An integer array is declared, temp[len], having the same length as the input array.

int temp[len];

To begin with, the elements of the input array are copied in the temp array.

for(int k = 0; k < len; k++ )

{

      temp[k] = arr[k];

}

Next, the elements of the input array are given new value.

The temp array, in reverse order, is copied into the input array.

for( int k = 0, j = len-1; k < len, j>= 0; k++, j-- )

{

          arr[k] = temp[j];

}

The above for loop makes use of two variables simultaneously.

While the array, arr is proceeding from first element to the next, the array temp begins with the last element and goes down to the previous element.

Now, the input array, arr, contains the elements in reverse order.

The complete program is given.

#include <iostream>

using namespace std;  

void reverse( int arr[], int len );

void reverse( int arr[], int len )

{

  int temp[len];

 

  for(int k = 0; k < len; k++ )

  {

      temp[k] = arr[k];

  }

 

  for( int k = 0, j = len-1; k < len, j>= 0; k++, j-- )

  {

          arr[k] = temp[j];

  }

 

}

int main()  

{

  int len = 5;    

  int arri[len];    

  for( int l = 0; l < len; l++ )

  {

      arri[l] = l;

  }

 

  reverse( arri, len );    

  return 0;

}


Related Questions

which of the following is an example of application software

Answers

Answer:

A messaging app

Explanation:

Its an software application you can download, so...yeah.

(You might've thought it was an anti-virus program lol)

Option-D.A messaging app is the correct answer.
A messaging app is an application software that can be installed jn your phone and computer in order to send messages.

What is an Application software?Application software is a type of computer application that performs specific professional, academic, and individualized functions.Each software is designed to assist users with a variety of tasks, some of which may be related to productivity, creativity, or communication.Word processors, media players, and accounting software are examples of application programs.An application program (also known as a software application, application, or app for short) is a computer program created to carry out a specific task other than one related to the operation of the computer itself.The term "app" typically refers to apps for mobile devices such phones. Applications may be published independently or packaged with the computer and its operating system software.They may also be written in proprietary, open-source, or project code.An application can work with text, numbers, audio, visuals, and a combination of these depending on the task for which it was created.Word processing is an example of an application package that focuses on a particular task.On the other hand, integrated software merges several programs.

To learn about the DIfference between application software and Opertaing system click here-
https://brainly.com/question/17798901

#SPJ2

Develop a program to sort a file consisting of bonks details in the alphabetical order of author names. The details of books include book id, author_name, price. no of pages, publisher, year of publishing
Please provide C++ program for above question.​

Answers

Use the knowledge in computational language in C++ to write the a code with alphabetical order of author name.

How to define an array in C++?

An Array is a set of values ​​arranged in lists and accessible through a positive numeric index. So, we have that each position of our Array is a variable of the type of our Array, so we have to have a way to initialize this set of variables.

#include <iostream>

#include <iomanip>

#include <fstream>

#include <string>

using namespace std;

struct Book {

   string title;

   string author;

};

const int ARRAY_SIZE = 1000;

Book books [ARRAY_SIZE];

string pathname;

ifstream library;

int LoadData();

void ShowAll(int count);

void ShowBooksByAuthor(int count, string name);

void ShowBooksByTitle(int count, string title);

void sortByTitle(int count, string title);

void sortByAuthor(int count, string author);

int main()

{  

   int count = 0;

   char selector = 'q', yesNoAnswer = 'n';

   string name;

   string title;

     cout << "Welcome to Forrest's Library Database." << endl;

   cout << "Please enter the name of the backup file: ";

   getline(cin, pathname);

   LoadData();

   count = LoadData();

   cout  << count << " records loaded successfully." << endl;

   do

   {

       cout << endl << "\t(S)how All, Search (A)uthor, Search (T)itle, (Q)uit: ";

       cin >> selector;

       selector = toupper(selector);

       switch(selector)

       {

           case 'S':

               sortByTitle(count, title);

               if (count <= 0)

                   cout << "No counts found!\n";

               else

                   ShowAll(count);

               break;

           case 'A':

               sortByAuthor(count, name);

               cout << "bookAuthor: ";

               cin.ignore();

               getline(cin, name);

               if (count <= 0)

                   cout << "No records found!\n";

               else

                   ShowBooksByAuthor(count, name);

               break;

           case 'T':

               sortByTitle(count, title);

               cout << "bookTitle: ";

               cin.ignore();

               getline(cin, title);

               if (count <= 0)

                   cout << "No records found!\n";

               else

                   ShowBooksByTitle(count, title);      

               break;

       }

   }

   while (selector != 'q' && selector != 'Q');

   return 0;

}

int LoadData()

{

   int count = 0;

   int i = 0;

   library.open(pathname);

   ifstream library(pathname);

   if (!library)

   {

       cout << "Cannot open backup file" << endl;

       return 0;

   }

   while (!library.eof())

   {

       getline(library, books[count].title);

       getline(library, books[count].author);

       count++;

   }

   return count;

}

void ShowAll(int count)

{

   for (int i = 0; i < count; i++)

   {

      cout << books[i].title << " " << "(" << books[i].author << ")" << endl;

   }

}

void ShowBooksByAuthor(int count, string name)

{

   int j = 0;

   for (int i = 0; i < count; i++)

   {

       if(books[i].author.find(name) < 100)

       {

           cout << books[i].title << " " << "(" << books[i].author << ")" << endl;

           j++;

       }

   }

   cout << j << " records found";}

void ShowBooksByTitle(int count, string title)

{

   int j = 0;

   for (int i = 0; i < count; i++)

   {

       if(books[i].title.find(title) < 100)

       {

           cout << books[i].title << " " << "(" << books[i].author << ")" << endl;

           j++;

       }

   }

   cout << j << " records found";

}

void sortByTitle(int count, string title) {

   string temp;

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

       for(int j = 0; j < count - i; j++) {

           if (books[j].title > books[j + 1].title) {

               temp = books[j].title;

               books[j].title = books[j + 1].title;

               books[j + 1].title = temp;

           }

       }

   }

}

void sortByAuthor(int count, string name) {

   string temp;

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

       for(int j = 0; j < count - i; j++) {

           if (books[j].author > books[j + 1].author) {

               temp = books[j].author;

               books[j].author = books[j + 1].author;

               books[j + 1].author = temp;

           }

       }

   }

}

See more about C++ at brainly.com/question/19705654

what is computers machain?

Answers

Answer:

the electronic device which take data process it and give meaningful results is called computer machine

Consider the following program written in C syntax:
void swap(int a, int b) {
int temp;
temp = a;
a = b;
b = temp;
} void main() { int value = 2, list[5] = {1, 3, 5, 7, 9};
swap(value, list[0]);
swap(list[0], list[1]);
swap(value, list[value]);
}
For each of the following parameter-passing methods, what are all of the
values of the variables value and list after each of the three calls to
swap?
1. Passed by value
2. Passed by reference
3. Passed by value-result
6.

Answers

The values of the variables value and list after each of the three calls to

swap are:

value = 2 and  list[5] = {1, 3, 5, 7, 9};value = 2 and  list[5] = {3, 1, 5, 7, 9};value = 2 and  list[5] = {3, 1, 5, 7, 9};

How to determine the values of variable value and the list?

1. Passed by value

In this case, the values of the actual arguments remain unchanged; So the variable value and the list would retain their initial values

The end result is:

value = 2 and  list[5] = {1, 3, 5, 7, 9};

2. Passed by reference

With pass by reference, the arguments are changed.

Given that

value = 2 and  list[5] = {1, 3, 5, 7, 9};

The value of variable value is swapped with list[0].

So, we have:

value = 1 and  list[5] = {2, 3, 5, 7, 9};

Then list[0] and list[1] are swapped

So, we have:

value = 1 and  list[5] = {3, 2, 5, 7, 9};

Lastly, value and list[value] are swapped

So, we have:

value = 2 and  list[5] = {3, 1, 5, 7, 9};

The end result is:

value = 2 and  list[5] = {3, 1, 5, 7, 9};

3. Passed by value-result

Since there is no loop in the program, the pass by value-result has the same output as the pass by reference.

So, the end result is:

value = 2 and  list[5] = {3, 1, 5, 7, 9};

Read more about C syntax at:

https://brainly.com/question/15705612

You can always trust information that comes from websites ending in. . com

Answers

Answer:

No, Don't go there I can name more than 3 websites that end in ".com" that u cant trust.

Explanation:

// This pseudocode segment is intended to compute and display
// the average grade of three tests for any number of students.
// The program executes until the user enters a negative value
// for the first test score.
start
Declarations
num test1
num test2
num test3
num average
housekeeping()
while test1 >= 0
mainLoop()
endwhile
endOfJob()
stop

housekeeping()
output "Enter score for test 1 or a negative number to quit"
return

mainLoop()
output "Enter score for test 2"
input test2
average = (test1 + test2 + test3) / 3
output "Average is ", average
output "Enter score for test 1 or a negative number to quit"
input tesst1
return

endOfJob()
output "End of program"
return

Answers

The pseudocode to calculate the average of the test scores until the user enters a negative input serves as a prototype of the actual program

The errors in the pseudocode

The errors in the pseudocode include:

Inclusion of unusable segmentsIncorrect variablesIncorrect loops

The correct pseudocode

The correct pseudocode where all errors are corrected and the unusable segments are removed is as follows:

start

Declarations

     num test1

     num test2

     num test3

     num average

output "Enter score for test 1 or a negative number to quit"

input test1

while test1 >= 0

     output "Enter score for test 2"

     input test2

     output "Enter score for test 3"

     input test3

     average = (test1 + test2 + test3) / 3

     output "Average is ", average

     output "Enter score for test 1 or a negative number to quit"

     input test1

endwhile

output "End of program"

stop

Read more about pseudocodes at:

https://brainly.com/question/11623795

20
Select the correct answer
Mike logged into a shopping website and entered his username and password, which protocol will the website use to verify his credentials?
A HTTP
B SMTP
C. СМР
D. POP3
E. LDAP

Answers

Answer:

LDAP

Explanation:

The Lightweight Directory Access Protocol (LDAP) is a vendor-neutral application protocol used to maintain distributed directory info in an organized, easy-to-query manner. That means it allows you to keep a directory of items and information about them. This allows websites to verify credentials when accessing websites.

Most graphics software programs give you the choice to work in either RGB or CMYK. What are these specifications called?
A.
digital codes
B.
color spaces
C.
computer graphics
D.
artwork

Answers

A - digital codes

Hope I’m right

Answer:B

Explanation:

1. What is TRUNC for Delphi
programming language?
Please explain in at least 200
words.

Answers

The Trunc function cut off a floating-point value by removing the fractional part. The Trunc  function often brings back an integer result as it is not a real function.

What is the Trunc function in Delphi?

When you look at the Delphi code, the Trunc function is known to be a fuction that reduces or cut off a real-type value and make it into an integer-type value.

Note that X is a real-type expression and so the Trunc is said to often brings back an Int64 value that is meaning the value of X approximated to zero and when the cut of value of X is not found in  the Int64 range, an EInvalidOp exception is brought up.

Learn more about programming language from

https://brainly.com/question/8151764

Two gamers are programming each player in a football team to throw a football
across the stadium at a specific speed to arrive at the running back's hand. Which is
the parameter and which is the argument in the code below?
The parameter and argument are the same, speed by 5 or 2
The parameter is speed, the argument is 5 or 2
The parameter is 5 or 2, the argument is speed
There are no parameters or arguments

Answers

The parameter and  the argument in the code below is that the parameter is speed, the argument is 5 or 2.

Can programmers be said to be gamers?

Gaming is known to be a kind of starting point for new set of programmers  as a lot of game designers do uses different kinds of skills.

Note that in the above scenario, it the parameter is speed, the argument is needs to be 5 or 2 for it to work well.

Learn more about code  from

https://brainly.com/question/25605883

9.12: Element Shifter
Write a function that accepts an int array and the array’s size as arguments. The function should create a new array that is one element larger than the argument array. The first element of the new array should be set to 0. Element 0 of the argument array should be copied to element 1 of the new array, element 1 of the argument array should be copied to element 2 of the new array, and so forth. The function should return a pointer to the new array. Demonstrate the function by using it in a main program that reads an integer N (that is not more than 50) from standard input and then reads N integers from a file named data into an array. The program then passes the array to your element shifter function, and prints the values of the new expanded and shifted array on standard output, one value per line. You may assume that the file data has at least N values.

Prompts And Output Labels. There are no prompts for the integer and no labels for the reversed array that is printed out.

Input Validation. If the integer read in from standard input exceeds 50 or is less than 0 the program terminates silently.

Answers

The Element shifter program illustrates the use of functions and arrays

Arrays are used to hold multiple valuesFunctions are used as subroutines of a program

The Element shifter program

The Element shifter program written in C++, where comments are used to explain each action is as follows:

#include <iostream>

using namespace std;

//This declares the ElementShifter function

int* ElementShifter(int *arr, int size){

   //This declares the new array

   int *newArr = new int[size * 2];

//The following loop populates the new array

   for (int i = 0; i < size * 2; i++) {

       if(i == 0){

           *(newArr+i) = 0;

       }

       else if(i < size+1){

           *(newArr+i) = *(arr+i-1);

       }

       else{

           *(newArr+i) = 0;

       }

   }

//This returns a pointer to the new array

   return newArr;

}

//The main method begins here

int main(){

//This declares and gets input for N

   int N;    cin>>N;

   int myArr[N];

//If N is between 1 and 50

   if(N > 0 && N <=50){

//This populates the array

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

           cin>>myArr[i];

       }

//This calls the Element shifter function

   int *ptr = ElementShifter(myArr, N);

//This prints the new array

   for (int i = 0; i < N*2; i++) {

       cout << ptr[i] << " ";

   }

   }

  return 0;

}

Read more abou C++ programs at:

https://brainly.com/question/27246607

Which of the following are vector graphic file formats? Choose all that apply.

AI

PNG

RAW

SVG
Please help

Answers

There are different kinds of files. The option that is a vector graphic file formats is SVG.

What are vector files?

Vector files are known to be a type of images that are created by using mathematical formulas that stands as points on a grid.

The SVG  is known as Scalable Vector Graphics file and it is known to be a  vector image file format as it make use of geometric forms such as points, lines, etc.

Learn more about vector graphic file from

https://brainly.com/question/26960102

Answer:

AI and SVG

Explanation:

learned it from a comment i give all credit to them

why is this not working for my plus membership

Answers

Answer:

The overwhelming main cause for PlayStation Plus subscriptions not being recognised is because of PlayStation server maintenance which prevents your PS4 from communicating with Sony and discovering that you are a paid up PS Plus subscriber.

what is containment and why is it part of the planning process

Answers

Answer:

Isolating affected channels, processes, services, or computers; stopping the losses; and regaining control of the affected systems. It is part of the planning process to identify the best containment option for each scenario or system affected.

Explanation:

Put the steps of the decision-making process in the correct order.
1. Step 1
Gather data.
2. Step 2
Analyze choices.
3. Step
Make the decision.
4. Step 4
Evaluate the decision.
5. Step 5
Determine the goals.

Answers

Answer:

step 5, step 1, step 2, step 3, step 4

Explanation:

I belive that would be the answer. I hope this helps.

which is considered both an input and output device?
A) Keyboard
B) Microphone
C) Speaker
D) Touchscreen Monitor
Please hurry :3 15 points

Answers

Answer:

speaker

Explanation:

its the one that gives sounds

Answer:

The answer would be D) Touchscreen Monitor

Explanation:

A Touchscreen monitor (such as a smartphone screen) outputs information to the user, while also recieving information from the user.

How can use of the Internet potentially be a security issue?

Programs, such as spyware, are mistakenly accessed by visiting an infected
website.
Individuals called viruses attempt to secretly enter another computer to harm it.
Phishing attempts to get someone's personal data with fake emails and social
media requests.
Unwanted software called hackers can transmit personal data from a computer.

Answers

Answer:

Unwanted software called hackers can transmit personal data from a computer.

Explanation:

The other options mention "attempt" meaning it hasn't happened yet. So I'm going to assume the last one is right. I'm not 100%

type of software designed for users to customise programs is?

Answers

Answer:
So easy the answer is Freeware
Explanation:

Define a function FindLargestNum() with no parameters that reads integers from input until a negative integer is read. The function returns the largest of the integers read

Answers

The FindLargestNum program is an illustration of function; where its execution is done when its name is called or evoked

The function FindLargestNum

The FindLargestNum function written in Python, where comments are used to explain each action is as follows:

#Thie defines the FindLargestNum function

def FindLargestNum():

   #This gets the first input

   num = int(input())

   #This initializes the minimum value

   maxm = num

   #The following is repeated until the user enters a negative input

   while num >= 0:

       #This determines the largest input

       if num > maxm:

           maxm = num

       #This gets the another input

       num = int(input())

   #This prints the largest input

   print(maxm)

Read more about functions at:

https://brainly.com/question/24941798

Steps of booting a computer

Answers

Steps of Booting
The Startup. It is the first step that involves switching the power ON. ...
BIOS: Power On Self Test. It is an initial test performed by the BIOS. ...
Loading of OS. In this step, the operating system is loaded into the main memory. ...
System Configuration. ...
Loading System Utilities. ...
User Authentication.

It is possible to publish a presentation online. True False

Answers

Answer:

It should be true

Explanation:

I don't see why it wouldn't

explains why it is important to select the correct data when creating a chart

Answers

Answer:

to be organized

Explanation:

because when you are organized to select the correct data, you won't confused

display unit is capable of displaying test but not ​

Answers

Answer:

I think your question must be display unit is capable of displaying text but not.

Explanation:

A text display is an electronic alphanumeric display device that is mainly or only capable of showing text, or extremely limited graphic characters.

Explain why database management systems are used in hospitals? Discuss

Answers

The reason why database management systems are used in hospitals is because the use of Healthcare databases aids in terms of diagnosis and treatment, handle documentation and billing, and others.

What is a database management system in healthcare?

A database management system (DBMS) is known to be a type of software that has been developed to help people to form and keep databases.

It is one that helps to lower the risk of errors associated with medical operations and management. It reduces  paperwork and staff and also improves  performance.

Learn more about database management from

https://brainly.com/question/24027204

9) Which date is assigned the serial number of 1?


A. January 1, 1700


B. January 1, 2000


C. January 1, 1900


D. January 1, 1800

Answers

Answer:

c) January 1, 1900

Explanation:

January 1, 1900 (1 - 1 - 1900) is assigned the serial number of 1. The serial number 1 represents January 1, 1900. Hence, option (c) is the correct answer.


Why do crawlers not use POST requests?

Answers

Answer:

Generally they do not do POST requests. This is just the current state of affairs and is not dictated anywhere, I believe. Some search engines are experimenting with crawling forms, but these are still GET requests.Explanation:

Which of the following are logical functions? Select all the options that apply.

Answers

Answer:

functions (reference)

Function Description

IFS function Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition.

NOT function Reverses the logic of its argument

OR function Returns TRUE if any argument is TRUE

Fumiko is a network technician. She is configuring rules on one of her company's externally facing firewalls. Her network has a host address range of 192.168.42.140-190. She wants to allow all hosts access to a certain port except for hosts 188, 189, and 190. What rule or rules must she write

Answers

The rule that she must write is that  A single rule allowing hosts 140–187 is all that is necessary; the default-deny rule takes care of blocking the remaining nonincluded hosts.

What is a Firewall?

A firewall is known to be a form of a network security device that helps one to manage, monitors and filters any form of incoming and outgoing network traffic.

This is often done based on an firm's formerly set up security policies. A  firewall is known as the barrier that exist between a private internal network and the public Internet.

See options below

What rule or rules must she write?

a) A single rule allowing hosts 140–187 is all that is necessary; the default-deny rule takes care of blocking the remaining nonincluded hosts.

b) Multiple rules are necessary for this configuration; one or more rules must define Deny exceptions for 188, 189, and 190, followed by the Allow rule for the 140–190 range.

c) A Deny rule is needed for 188, 189, and 190, and then exception rules for the 140–187 range.

d) The default Deny all rule needs to be placed first in the list, and then an exception rule for the 140–187 range.

Learn more about firewalls from

https://brainly.com/question/13693641

Strategies of Green computing include:

Answers

Answer:

Equipment recycling, reduction of paper usage, virtualisation, cloud computing, power

I of 60
MUL
FINISI
a
The view in which the field data types and field properties for a database table can be seen in Microsoft
Access is called the...
0.5 POINTS
A
00
Datasheet view
B
design view
с
D
SQL view
dashboard view
E
field view

Answers

The view in which the field data types and field properties for a database table can be seen in Microsoft Access is called the Datasheet view.

What is datasheet view?

A datasheet form is known to be the view that shows a user the information recorded using a table.

Note that the properties of a field tells users the characteristics and attributes of data added to that field. A field's data type is therefore a vital  property as it helps one to know the kind of data the field can save.

Learn more about database  from

https://brainly.com/question/26096799

Other Questions
what is the arrow pointing to? i need urgent help! How does your Web browser get a file from the Internet? Your computer sends a requestfor the file to a Web server, and the Web server sends back a response. For oneparticular Web server, the time X (in seconds) after the start of an hour at which arandomly selected request is received has the uniform distribution shown in the figure. in What is the correct answer? what are two basic properties of the gas phase All the clocks below show the time in the aftemoon or evening. Write the times below the clocks using 24 hour time. Time is Time is Times Times Chase was on his schools track team and ran the 2400m race. He has been working on his pace and can run 1600m in 5.5 minutes. If he keeps this pace through the entire race, how long will it take him to finish the 2400m race? In a Cournot oligopoly with N-number of firms and identical marginal costs, if the number of firms decreases because firms exit, we know that the markup of price over cost will Group of answer choices increase. decrease. stay the same. unknown for lack of other information. Two years ago my dog, Bau, was five times older than mu cat, Miho. 1 year from now Bau will only be twice as old as Miho. How old is Bau now? Which algebraic expression is equivalent to this expression?9(3x - 12) + 9x A. 36x - 12 B. 18x + 108 C. 36x - 108 D. 18x - 108 b) They (go) to Kathmandu. (future perfect 7. Susan has $21, and she has three times as much money as Diego. Write an equation for thissituation, and find how much money Diego has. SOMEONE PLEASE HELPP!! The rate at which an object weathers is determined by many different variables. For example, compare the two ancient Egyptian structures below.Compare the obelisk from the temple of Luxor in Egypt (left) and the Egyptian obelisk called Cleopatra's Needle in New York (right).Both structures were carved in Egypt from the same type of rock more 1,000 years ago. However, the obelisk in New York, which was transported there from Egypt in 1881, has since experienced a much higher rate of weathering. What factors likely sped up the weathering process for the structure that was moved to New York? Please help. I just want to get this done and enjoy my Sunday POR VS PARAFul a la agencia de viajes porque quera ir (1) Mendoza (2)lavisitar a mi novia, Silvia. Entr (3)puerta y Marta, la agente de viajes, me dijo: "Tengo una oferta excelente (4) til". Me explic que poda viajar enavin (5) Buenos Aires (6)seiscientos dlares. Podia salir un da de semana, (7) ejemplo lunes omartes. Me poda quedar en un hotel en Buenos Aires (8) quince dlares (9) noche. Luego viajara(10) tren a Mendoza (11) encontrarme con Silvia. "Debes comprar el pasaje (12) el fin de mes",me recomend Marta. Fue la oferta perfecta (13) mi. Llegu a Mendoza y Silvia fue a la estacin (14)yLlev unas flores (15) vella. Estuve en Mendoza (16) un mes y (17) fin Silvia y yo noscomprometimos. Estoy loco (18) vella.mi Find the value of : A triangular prism is 15 yards long and has a triangular face with a base of 12.9 yards and a height of 10.3 yards. what is the volume of the triangular prism? Which expression is equivalent to the expression shown below?-9.25(2n-3) - 8nA. -18.5n + 19.75B. 55.5n+ 27.75C. 26.5n + 19.75D. 27.75 -26.5n conjugate narrar in the sentence el profesor (blank) el cuento cuando el timbre soo Hi I new to brainly what dose paws off mean???