Which programming term describes the value that is passed to a method when called
so that the method knows what to do?
A parameter
An argument
A function
A variable
The programming term that describes the value that is passed to a method when called so that the method knows what to do is an Argument
What is an Argument?
An argument in Programming are variables used to specify a value when you want to call a fuhnction which provides the programs utilizing more informathion.
A bettrer understanding is as follows:
create a function, pass in data in the form of an argumentProgram utilizes more information from the value of the argument.For example
Say you want to create a function that describes how much money you're having; We can use artgument to descriptive as possible.
Before now, the function may have looked like:
string howMuchmoney() {
return "so much money";
Modifying the function prototype and implementation to take a string argument, it becomes
string howMuchmoney(string amount);
Change your return statement to:
return amount + "money";
Add a string to the parentheses where you call the function:
howMuchmoney("tons of")
Learn more in using Argument here:https://brainly.com/question/6067168
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.
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
display unit is capable of displaying test but not
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.
Strategies of Green computing include:
Answer:
Equipment recycling, reduction of paper usage, virtualisation, cloud computing, power
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.
The Element shifter program illustrates the use of functions and arrays
Arrays are used to hold multiple valuesFunctions are used as subroutines of a programThe Element shifter programThe 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
explains why it is important to select the correct data when creating a chart
Answer:
to be organized
Explanation:
because when you are organized to select the correct data, you won't confusedTwo 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
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
1. What is TRUNC for Delphi
programming language?
Please explain in at least 200
words.
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
What command allows the root user to create a crontab file for the user jdoe?
The command allows the root user to create a crontab file for the user jdoe is As root, execute crontab -e jdoe.
What is the command in crontab?The crontab command is known to be that often submits, make some editing, lists, or delete cron jobs.
Note that A cron job is a type of command that is often aided or run by the cron daemon at a consistent and scheduled times.
Conclusively, The As root, execute crontab -e jdoe command will give room for the root user to create a crontab file for the user named jdoe.
Learn more about command form
https://brainly.com/question/25243683
This week, we have covered network management which include topics such as System message log, SNMP, Netflow, QoS, VPN, and default gateway redundancy. Discuss one feature you would implement in your network and how you use it.
There are lot of system network. I would love to implement the use of VPN in my network.
What is a gains of implementing a VPN?The use of VPNs is one that helps a person to have a better form of total security, it also make performance better, remote access, anonymity, an others.
Conclusively, Note that the use of VPN can be affordable as it is cheap and it can prevent hackers having access to your data or system.
Learn more about VPN from
https://brainly.com/question/25554117
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.
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%
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
The FindLargestNum program is an illustration of function; where its execution is done when its name is called or evoked
The function FindLargestNumThe 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
why is this not working for my plus membership
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.
Write multiple if statements:
If carYear is before 1967, put "Probably has few safety features.\n" to output.
If after 1970, put "Probably has head rests.\n" to output.
If after 1992, put "Probably has anti-lock brakes.\n" to output.
If after 2002, put "Probably has airbags.\n" to output.
Ex: If carYear is 1995, then output is:
Probably has head rests.
Probably has anti-lock brakes.
Hope this is good enough! Good luck.
6. Create lookup functions to complete the summary section. In cell I6, create a formula using the VLOOKUP function to display the number of hours worked in the selected week. Look up the week number in cell I5 in the range A17:G20, and return the value in the 2nd column. Use absolute references for cell I5 and the range A17:G20.
Answer:
Reporting period hours Timesheet Due Name 44260 Period Start 44228 Period End 40965 Summary Balances Date Completed 43722 Week # 1 Period Start Period End Worked
what is computers machain?
Answer:
the electronic device which take data process it and give meaningful results is called computer machine
Which of the following are logical functions? Select all the options that apply.
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
Complete the sentence.
Times New Roman, Courier New, Arial and Verdana are all examples of _____.
1. web-safe colors
2. web-safe fonts
3. formatting templates
4. accessible fonts
Answer:
web-safe fonts
Explanation:
Because if you look at the different fonts they are all readable
Answer: 2. web-safe fonts
Explanation: got it right on edgen
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
Answer:B
Explanation:
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
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
which of the following is an example of application software
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.
To learn about the DIfference between application software and Opertaing system click here-
https://brainly.com/question/17798901
#SPJ2
Computer A uses Stop and Wait ARQ to send packets to computer B. If the distance between A and B is 40000 km, the packet size is 5000 bytes and the
bandwidth is 10Mbps. Assume that the propagation speed is 2.4x108m/s
a) How long does it take computer A to receive acknowledgment for a packet?
b) How long does it take for computer A to send out a packet?
The time that it takes the computer to receive acknowledgment for a packet is 0.1667 seconds. The time it takes to send out a packet is 4 x 10⁻³seconds
1 The acknowledgment time for the packetspeed = 2.4x108m/s
Distance = 40000 km,
Time = distance/ speed
= 40000 x10³/ 2.4x10⁸m/s
= 0.1667
The time that it take is 0.1667 seconds.
b. Number of bytes = 5000
5000x 8 = 40000bits
10 mbps = 10000 kbps
10000 kbps = 10000000
packet size / bit rate = 40000/10000000
= 4 x 10⁻³seconds to send a packet out
Read more on computer bandwith here: https://brainly.com/question/27020560
A team member who does not feel comfortable disagreeing with someones opinion in front of the team would most likely come from a
Answer:
discussions and decisions made about public policy
Explanation:
Intro to Computer Science:
A zero-tolerance policy means that if the employee violates the policy, they will be _____.
promoted
fired
warned
reprimanded
The correct answer is: fired :)
A zero-tolerance policy means that if the employee violates the policy, they will be fired. Thus, the correct answer is option B.
What is a Zero-tolerance policy?A zero tolerance policy is one that penalizes every violation of a stated rule. People in positions of authority are prohibited by zero tolerance policies from exercising discretion or changing punishments to fit the circumstances subjectively. They must impose a predetermined punishment regardless of individual guilt, extenuating circumstances, or history.
Zero tolerance policies are studied in criminology and are used in both formal and informal policing systems worldwide. If an employee violates the policy, there will be no tolerance and they will be fired.
Therefore, a zero-tolerance policy means that if the employee violates the policy, they will be fired.
To learn more about zero-tolerance policy, click here:
https://brainly.com/question/27293242
#SPJ2
type of software designed for users to customise programs is?
which is considered both an input and output device?
A) Keyboard
B) Microphone
C) Speaker
D) Touchscreen Monitor
Please hurry :3 15 points
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.
The algorithm solves the problem
of size n by recursively solving
sub-problems of size n – 1, and
then combining the solutions in
Q(n) time.
Looking at the question on algorithm above, the correct answer is: [tex]O( {2}^{n} )[/tex]
What is algorithm?Algorithm refers to a sequence of instructions that have been well-defined which helps to solve specific problems. Algorithm is used in computation.
The recurrence relation is:
T(n)=2.T(n-1)+c , n>0
T(n)=1, n=0.
Considering the back substitution method,
T(n) = 2kT(n-k)+ 2k-1c+....+20c
Substitute n-k=0
Therefore, we will have:
T(n) = 2nT(0)+ 2k-1c+....+20c
T(n) = [tex] {2}^{n - 1} + 1[/tex]
T(n) = [tex]O( {2}^{n} )[/tex]
Learn more about algorithm on https://brainly.com/question/24953880
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.
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
A desktop is one kind of computer. Name two other kinds?
Answer:
Notebook, supercomputer.
Explanation:
Notebooks are laptops, usually low performance.
Supercomputers are the best performing computers in the world.
Answer:
super computers and mainframe computers
Explanation:
these computers were used way before desktop computers
You can always trust information that comes from websites ending in. . com
Answer:
No, Don't go there I can name more than 3 websites that end in ".com" that u cant trust.
Explanation: