Write the definition of a function named isPositive, that receives an integer argument and returns true if the argument is positive, and false otherwise. So, if the argument's value is 7 or 803 or 141 the function returns true. But if the argument's value is -22 or -57, or 0, the function returns false.

Answers

Answer 1

Answer:

// header files

#include <iostream>

using namespace std;

// required function

bool isPositive(int num)

{

// check if number is positive

if (num > 0)

{

// return true

return true;

}

// if number is 0 or negative

else

{

// retrun false

return false ;

}

}

// main function

int main() {

// test the function with different values

cout<<isPositive(7)<<endl;

cout<<isPositive(803)<<endl;

cout<<isPositive(141)<<endl;

cout<<isPositive(-22)<<endl;

cout<<isPositive(-57)<<endl;

cout<<isPositive(0)<<endl;

return 0;

}


Related Questions

Which web-authoring software enables users to create sophisticated web pages without knowing any html code?.

Answers

Answer: One of the best software

Explanation: Dreamweaver!

In a relocatable dynamic partition scheme, the ____ contains a value that must be added to each address referenced in a program so that the system will be able to access the correct memory addresses after relocation. a. compaction register b. bounds register c. load register d. relocation register

Answers

In a relocatable dynamic partition scheme, the  bounds register contains a value that must be added to each address referenced in a program.

What is bounds registers?

This is known to be two registers that has its contents that are known are used to tell an area of memory where one can have access control.

Therefore, In a relocatable dynamic partition scheme, the  bounds register contains a value that must be added to each address referenced in a program.

Learn more about bounds register from

https://brainly.com/question/15041633

#SPJ1

As part of your regular system maintenance, you install the latest operating system updates on your Windows 10 computer. After several days, you notice that the system locks up and reboots from time to time. You suspect that a recent update is causing the problem. How can you quickly restore the computer to its state before the updates

Answers

Answer is restore the system using a restore point.
Explained: System Restore lets you roll your system settings back to a specific date when everything was working properly.

(n) ____ operator requires a single operand either before or after the operator. unary single binary

Answers

A unary operator requires a single operand either before or after the operator.

Who is a  unary operator?

This is known to be a person or  an operator that is often known to use or operate only on a single operand so as to return a new value.

Note that A unary operator requires a single operand either before or after the operator.

Learn more about   unary operator from

https://brainly.com/question/13814474

#SPJ1

Select the correct answer.
What does firewall software do?
A.
It improves network connectivity.
B.
It monitors network traffic to block malicious content.
C.
It adds some new features to the operating system.
D.
It installs viruses in the system.

Answers

Answer:

B

because it is an antivirus

Write a function named swapFrontBack that takes as input an array of integers and an integer that specifies how many entries are in the array. The function should swap the first element in the array with the last element in the array. The function should check if the array is empty to prevent errors. Test your function with arrays of different length and with varying front and back numbers.

Answers

Answer:

#include <iostream>

#include <vector>

using namespace std;

void swapFrontBack(vector<int>& nums) {

if(nums.size() < 2) {

return;

}

swap(nums[0], nums[nums.size()-1]);

}

void printit(vector<int>& arr) {

for(int i = 0; i < arr.size(); i++) {

cout << arr[i] << " ";

}

cout << endl;

}

int main() {

vector<int> num1;

swapFrontBack(num1);

printit(num1);

num1.push_back(1);

swapFrontBack(num1);

printit(num1);

num1.push_back(2);

swapFrontBack(num1);

printit(num1);

vector<int> num2(10, 1);

num2[9] = 2;

swapFrontBack(num2);

printit(num2);

return 0;

}

Explanation:

Chris is responding to a security incident that compromised one of his organization's web servers. He believes that the attackers defaced one or more pages on the website. What cybersecurity objective did this attack violate

Answers

The cybersecurity objective that the above attack violate is known as Integrity.

What is Cybersecurity aims?

Their objectives is majorly to protect any computers system, networks, and other kinds of software programs from any type of cyber attacks.

Note that The cybersecurity objective that the above attack violate is known as Integrity as they are not the kind of people that keep to their words.

Learn more about cybersecurity from

https://brainly.com/question/12010892

#SPJ1

The four memory management techniques presented in this chapter share the requirement that the entire program being executed must be ____.

Answers

The four memory management techniques requires that the entire software program that's being executed must be loaded into memory.

What are the 4 memory management techniques?

In Computer science, there are four memory management techniques and these include the following:

Single contiguous allocation.Partitioned allocation.Paged memory management.Segmented memory management.

As a general rule, the aforementioned memory management techniques requires that the entire software program that's being executed must be loaded into memory.

Read more on memory here: https://brainly.com/question/13081782

#SPJ1

Think about how you view your emails—either the email service you use yourself or an email service you would choose to use. Describe that email service and then explain whether you use POP3 or IMAP to access your email. How do you know it’s POP3 as opposed to IMAP?

Answers

Answer:

and POP3, followed in later years. POP3 is still the current version of the protocol, though this is often shortened to just POP. While POP4 has been proposed, it's been dormant for a long time.

IMAP, or Internet Message Access Protocol, was designed in 1986. Instead of simply retrieving emails, it was created to allow remote access to emails stored on a remote server. The current version is IMAP4, though most interfaces don't include the number.

The primary difference is that POP downloads emails from the server for permanent local storage, while IMAP leaves them on the server while caching (temporarily storing) emails locally. In this way, IMAP is effectively a form of cloud storage.

Think about how you view your emails is either the email service you use yourself or an email service you would choose to use POP3, followed in later years.

What is POP3?

POP3, followed in later years as the POP3 is still the current version of the protocol, though this is often shortened to just POP. While POP4 has been proposed, it's been dormant for a long time.

IMAP, or Internet Message Access Protocol, was designed in 1986. Instead of simply retrieving emails, it was created to allow remote access to emails stored on a remote server. The current version is IMAP4, though most interfaces don't include the number.

The primary difference is that POP downloads emails from the server for permanent local storage, while IMAP leaves them on the server while caching (temporarily storing) emails locally. In this way, IMAP is effectively a form of cloud storage.

Therefore, Think about how you view your emails is either the email service you use yourself or an email service you would choose to use POP3, followed in later years.

Learn more about emails on:

https://brainly.com/question/14666241

#SPJ2

You are the computer specialist in a small business. Your company server is named FS1 and has an IP address of 10.0.0.2. The hardware in your company server started to experience intermittent failures, so you transferred the shares on the server to a spare server and took the main server offline. The spare server has an IP address of 10.0.0.3. You edit the existing A record for FS1 on your company's DNS server and redirect the hostname to the spare server's IP address of 10.0.0.3. Afterward, most users are able to access the shares on the spare server by hostname, but several users cannot. Instead, they see an error message indicating that the FS1 server could not be found. Enter the command you can run from the command prompt on these workstations that will allow them to access the shares on FS1 without performing a full restart.

Answers

The command for the above case is:

ipconfig /flushdns

Deletes local DNS name cache

What is  system command?

This is known to be a form of a user's instruction that is often given by the computer and it is one that requires for action to be done by the computer's executive program.

Note that The command for the above case is:

ipconfig /flushdns

Deletes local DNS name cache

Learn more about  IP address from

https://brainly.com/question/24930846

#SPJ1

1. Explain what peer to peer networking is.
2. Describe at least one pro and one con of peer to peer networking.
3. Describe at least one pro and one con of network printer connections.
4. Describe at least one pro and one con of local printer connections.
5. Choose and explain, step by step, one method of backing up student files either manually or using a cloud service.

Answers

Peer-to-peer networking

Peer-to-peer networking is a term used to describe a system of communication that allows a group of computers to exchange information in a permissionless way.

One pro of -peer-to-peer networking is that it decentralizes how information is transferred and secured since files are stored on just a single device.

On the other hand, a con of peer-to-peer networking is the possible exposure to harmful data such as malware. been transferred from another computer.

You can learn more about peer-to-peer networks from a similar question here https://brainly.com/question/1932654

#SPJ1

which Yandere Simulator update removed the box of matches?

Answers

Answer:

Fixed the glitchy physics of Yandere-chan’s latest hairstyle. Removed exploit that allowed players to keep a character stationary indefinitely by talking to a student about their Task and never dismissing the Task Window. Adjusted the pathfinding grid so that it should be less likely for a student’s path to the male locker room to be blocked.

Explanation:

Answer:

i couldnt find the exact year but heres a list of bug fixes n stuff if this helps

Explanation:

https://yandere-simulator.fandom.com/wiki/Update_History

HELP! Write a program that generates 6 random numbers between 0 and 30, prints the numbers as shown, calculates the sum and the average of these numbers, and prints them

Answers

The program that generates 6 random numbers between 0 and 30 and makes mathematical computations is:

import random

import statistics

a = random.random()

b = random.random()

c = random.random()

d = random.random()

e = random.random()

f = random.random()

print("Generated Numbers:")

print(a, b, c, d, e, f)

seq = (a, b, c, d, e, f)

mean = statistics.mean(seq)

median = statistics.median(seq)

mode = statistics.mode(seq)

print("Mean =", mean)

print("Median =", median)

print("Mode =", mode)

Read more about programming here:

https://brainly.com/question/23275071

#SPJ1

10101 base 2 - 110+2​

Answers

Answer:

-87

Explanation:

(10101 base 2) = 21

21 - 110 +2 = -87

Which type of input devices used in big hero 6 movie

Answers

The  Input Devices Used in Movie Big Hero are:

A joystick medical robot Armored exoskeleton Jet-boots.

What are input device?

This is known to be a is a piece of instrument that helps gives or provide data to any information processing system.

Note that the Input Devices Used in Movie Big Hero “6”  are  a medical robot made by by Tadashi Hamada., Armored exoskeleton and others.

Learn more about input device from

https://brainly.com/question/24455519

#SPJ1

_____ are standard settings that control how the screen is set up and how a document looks when you first start typing

Answers

The standard settings that control how the screen of a computer is set up and how a document looks when you first start typing is called default settings.

What is a word processing software?

A word processing software can be defined as a type of software that is designed and developed so as to enable its end users type, format and save text-based documents such as:

In Computer technology, the standard settings that control how the screen of a computer is set up and how a document looks when you first start typing on a word processing software is called default settings.

Read more on word processing here: brainly.com/question/24043728

#SPJ1

(a) What are computer scanning device
(b)Name the type of scanner used:

Answers

Answer
Answer A):- A scanner is a device that captures images from photographic prints, posters, magazine pages and similar sources for computer editing and display. Scanners work by converting the image on the document into digital information that can be stored on a computer through optical character recognition (OCR).

Answer b):-The information will include; cost, and how its used The four common scanner types are: Flatbed, Sheet-fed, Handheld, and Drum scanners.
Hope it Helps!

If you want to stop a loop before it goes through all of its iterations, the break statement may be used. Group of answer choices True False

Answers

Answer:

Answer is true

Explanation:

1. A teacher asked a student to capture and print out a one-slide presentation using MSWord,       showing everything on the screen.
i)       What keys or combination of keys can be used to carry out this operation ?
ii)     Describe the procedures to be followed by the student in carrying out this operation?
iii)  Describe the procedure to be followed by the student in carrying out this assignment using the keyboard.
b) A system Analyst was hired to set up a computer laboratory for Gan di Gan International      School,
    i.) Mention three hardware devices the analyst would need to set up the laboratory
   ii) List two database applications likely to be recommended by the analyst
  iii) State five Word Processing packages likely to be installed

Answers

The keyboard combinations that can be used to capture and print out a one-slide presentation using MSWord, showing everything on the screen is Function key + PrtScr

What is a Key Combination?

This refers to the procedure that is used to combine two or more keys on the keyboard to execute a task.

Hence, we can see that the procedure that can be used to carry out the operation is:

Enter the screen you want to capture and printPress the Function key, followed by the PrtScr. Please note this can vary slightly, depending on the keyboard.

The hardware devices that would be needed to be set up by the system analyst at a computer laboratory are:

System UnitLaptops/MonitorPower adaptersEthernet cables, etc

The database applications that can be recommended by the system analyst are:

MySQL, SQL Server

The five word processing packages that are likely to be installed are:

G00..gle DocsMsWordMSOfficeDropbox PaperCorel WordPerfect

Read more about word processing here:

https://brainly.com/question/985406

#SPJ1

Self-driving cars are a result of developments in which field of computer
science?

Answers

Answer: I think Artificial Intelligence (AI)

Explanation:

In 25 words or fewer, explain why businesses use social media to digitally market their products.

Answers

Due to the accessibility of social media platforms, businesses have the opportunity to follow their potential customers. Social media marketers need to know more about their target market's needs, wants, and interests in order to develop a more effective marketing plan to draw in these potential customers.

What is social media?

Social media is a term used to describe online communication. Social media systems enable users to have discussions, exchange information, and create content for the internet.

Users utilize social media networks, sometimes referred to as digital marketing, as a platform to create social networks and share information in order to develop a company's brand, boost sales, and enhance website traffic.

Hence, the significance of the social media is aforementioned.

Learn more about on social media, here:

https://brainly.com/question/18958181

#SPJ1

Despite how well you might take care of your computer, problems can always arise. when troubleshooting problems you encounter, at what point should you engage a professional for assistance? why? at what point might you consider purchasing a new computer?

Answers

If troubleshooting problems is the one you encounter, the best thing to do is for one to get a professional to help one to see if the problem with the hardware  is one that is within the computer chassis.

What is troubleshooting?

Troubleshooting is known to be a form of systematic method that is often used in problem-solving that is known to help one to see and also correct issues that are linked with complex machines, electronics, computers and software systems.

Hence, If troubleshooting problems is the one you encounter, the best thing to do is for one to get a professional to help one to see if the problem with the hardware  is one that is within the computer chassis.

Learn more about troubleshooting from

https://brainly.com/question/9572941

#SPJ1

The constructor for Object supports methods that are used to retrieve and define properties for any object. True False

Answers

The constructor for Object supports methods that are used to retrieve and define properties for any object is a True statement.

What is the constructor of an object?

The Object constructor is known to be one that forms an object wrapper for any kind of given value.

When the value is null or undefined , it will form and return an empty object and as such, The constructor for Object supports methods that are used to retrieve and define properties for any object is a True statement.

Learn more about Object supports  from

https://brainly.in/question/34445581

#SPJ1

A license may limit the use of a software application to a specific device. Group of answer choices True False

Answers

Answer:

true

Explanation:

When evaluating a website's content, whether or not the information is up to date is considered part of the ________ element.

Answers

The currency element constitutes information whether the information of the website is current or up to date.

Website

A website is a term used to describe unique publicly accessible web pages that are identified by a domain name. Information on websites is typically updated by website owners, hence, some websites may not be updated frequently when compared to others. Thus, the currency element is an element users take into consideration when evaluating a website's content, whether or not the information is up to date.

You can learn more about the currency element here https://brainly.in/question/48673521

#SPJ1

Assume your organization has 200 computers. You could configure a tool to run every Saturday night. It would query each of the systems to determine their configuration and verify compliance. When the scans are complete, the tool would provide a report listing all systems that are out of compliance, including specific issues. What type of tool is being described

Answers

The tool that would provide a report listing all systems that are out of compliance, including specific issues is Security Compliance Manager.

What are compliance tools?

The Security Compliance Manager is known to be a form of downloadable tool that one can use as it helps a person to plan, ascribe, operate, and manage a person's security baselines for Windows client and other forms of server operating systems.

Note that in the case above, The tool that would provide a report listing all systems that are out of compliance, including specific issues is Security Compliance Manager.

Learn more about Security Compliance Manager from

https://brainly.com/question/24338783

#SPJ1

Ready to attempt the final challenge? Supply the 3 passwords you received via the first 3 challenges to proceed! Password from challenge #1 (all lowercase): Password from challenge #2 (all lowercase): Password from challenge #3 (all lowercase):

Answers

Using the knowledge in computational language in python it is possible to write a code that through a list manages to organize the largest and smallest numbers in order.

Writting the code in python:

# finding largest in the list

list_max = challenge3[0]

for i in range(len(challenge3)) :

   if challenge3[i] > list_max :

       list_max = challenge3[i]        

print("largest in the list = ", list_max)

# number of times largest occurs in list

max_count = 0

for i in range(len(challenge3)) :

   if challenge3[i] == list_max :

       max_count += 1        

print("number of times largest occurs in list = ", max_count)

# finding second largest in the list

list_sec_max = challenge3[0]

for i in range(len(challenge3)) :

   if challenge3[i] > list_sec_max and challenge3[i] < list_max :

       list_sec_max = challenge3[i]        

print("second largest in the list = ", list_sec_max)

# number of times second largest occurs in list

sec_max_count = 0

for i in range(len(challenge3)) :

   if challenge3[i] == list_sec_max :

       sec_max_count += 1        

print("number of times second largest occurs in list = ", sec_max_count)

# location of first occurence of largest in the list

first_index = -1

for i in range(len(challenge3)) :

   if challenge3[i] == list_max :

       first_index = i

       break        

print("location of first occurence of largest in the list = ", first_index)

# location of first occurence of largest in the list

last_index = -1

for i in range(len(challenge3) - 1, -1, -1) :

   if challenge3[i] == list_sec_max :

       last_index = i

       break        

print("location of first occurence of largest in the list = ", last_index)

See more about python at brainly.com/question/13437928

#SPJ1

What was one effect of better printing methods during the Ming Dynasty? Updated trade routes A new merchant class Increased literacy rates More codes and laws

Answers

The one effect of better printing methods during the Ming Dynasty For millennia its mastery made China the only withinside the international capable of produce copies of texts in splendid numbers and so construct the biggest repository of books.

What have been 3 consequences of the printing revolution?

Printed books have become extra conveniently to be had due to the fact they have been less difficult to supply and inexpensive to make. More humans have been capable of learn how to study due to the fact they may get books to study.

As in Europe centuries later, the advent of printing in China dramatically diminished the fee of books, for that reason assisting the unfold of literacy. Inexpensive books additionally gave a lift to the improvement of drama and different kinds of famous tradition. Freed from time-ingesting hand copying, the unfold of tradition and know-how accelerated, ushering international civilization onto a brand new stage.

Read more about the Ming Dynasty:

https://brainly.com/question/8111024

#SPJ1

Answer:

c

Explanation:

Write a method reverse that takes an array as an argument and returns a new array with the elements in reversed order. Do not modify the array.

Answers

Answer:

public class ArrayUtils

{

//function to reverse the elements in given array

public static void reverse(String words[])

{

//find the length of the array

int n = words.length;

//iterate over the array up to the half

for(int i = 0;i < (int)(n/2);i++)

{

//swap the first element with last element and second element with second last element and so on.

String temp;

temp = words[i];

words[i] = words[n - i -1];

words[n - i - 1] = temp;

}

}

public static void main(String args[])

{

//create and array

String words[] = {"Apple", "Grapes", "Oranges", "Mangoes"};

//print the contents of the array

for(int i = 0;i < words.length;i++)

{

System.out.println(words[i]);

}

//call the function to reverse th array

reverse(words);

//print the contents after reversing

System.out.println("After reversing............");

for(int i = 0;i < words.length;i++)

{

System.out.println(words[i]);

}

}

Explanation:

Which feature of cryptography is used to prove a user's identity and prevent an individual from fraudulently reneging on an action?

Answers

A feature of cryptography which is used to prove an end user's identity and prevent an individual from fraudulently reneging on an action is nonrepudiation.

What is nonrepudiation?

Nonrepudiation can be defined as an assurance that the sender of a message is given a proof of delivery and the recipient of this message is also provided with a proof of the sender’s identity, so none of them can deny having processed this message.

This ultimately implies that, nonrepudiation is a security service which has a feature of cryptography and it can be used to prove an end user's identity and prevent an individual from fraudulently reneging on an action

Read more on nonrepudiation here: brainly.com/question/14631388

#SPJ1

Other Questions
How does the author develop the theme of time (the past and the present and future) within the poem? Daniel is a football enthusiast. He watches all the big games, collects football memorabilia, and knows everything there is to know about football history. His best friend Charles is not a football fan. However, he does enjoy watching the Super Bowl every year because of all the excitement. He even finds that he gets really into the game. Usually the Super Bowl is the only football game Charles watches, but he still looks forward to it every year. Daniel has a(n) ____________ involvement with football, whereas Charles has more of a(n) _____________involvement. ||Define Sadness||ty~ Based on "Ain't I a Woman?" how did Truth most likely feel about the anti-suffragist idea that women were too sentimental and emotional to be involved in politics?She likely agreed, since she endured a great deal of hardship and struggle in her life.She likely agreed, since she asserted that women had more important pursuits than winning the right to vote.She likely disagreed, since she believed that women were more qualified than men to participate in government.She likely disagreed, since she believed that women could be just as strong and resilient as men. An electric field travels away from a charge and toward a _?_ charge. 3 red balls, 4 white balls, and 1 green ball are in a bag. Balls are drawn without replacement. Find the probability that the red balls can be drawn before the green ball is drawn. To deal with the challenges posed by the midlatitude temperate climate, Europeans have developed a sophisticated system of: Which of the following is not a step in logical reasoning? A. Research other sources B. Identify the best point C. Draw a conclusion D. Identify the main idea A certain test is designed to measure the satisfaction of an individual with his/her relationship. Suppose that the scores on this test are approximately normally distributed with a mean of 60 and a standard deviation of 8. An individual with a score of 50 or less is considered dissatisfied with his/her relationship. According to this criterion, what proportion of people in relationships are dissatisfied? Round your answer to at least four decimal places. I need the answer please work out this tough question for me please help! :(Kathy distributes jelly beans among her friends. Alia gets 4^2 fewer jelly beans than Kelly, who gets 3^3 jelly beans. How many jelly beans does Alia get?a. 4^2 - 3^3b. 3^3 + 4^2c. 4 - 3^3d. 3^3 - 4^2e. 3^2 - 4^3 select the value of y in terms of x. please help which of the following were most similair? A. The Mayflower Compact And John Lockes Social Contract TheoryB. The English Bill Of Rights And Thomas Paine Common SenseC. Magna Carta and Montesquieus Seperation Of PowersD. The Mayflower Compact and Montesquieus Seperation Of Powersif u answer correct ill give u brainliest! if u answer just for points ill report your account !!! Multiple Select Question Select all that apply Bad Debt Expense ______. (Check all that apply.) Multiple select question. should exceed the revenue generated from incurring the cost is a cost of extending credit to customers is based on actual events and does not require estimation is an estimate The algebraic rule for a reflection over the x-axis is- what is the force that holds atoms together Which information can be determined from the data on the graph? A. The average person in the United States uses more energy than the average person in Germany or France. B. The average person in Japan uses less energy than the average person in any other country in the world. C. Canada uses more total energy than Russia. D. People in North America and Europe use more energy than people in Africa and Asia. 2. Which scenario is an example of contributing to the common good?OA group of students cleans up a local parkA group of students plays basketball after ool.A family travels on vacation once a year.A person puts his or her money in a bank account. (please answer quick, i'm timed!!)What is the simplest form of StartRoot 1,764 EndRoot?A] 21B] 42C] 3^2(7^2)D]2^2(3^2)(7^2) What happens during prophase? A) chromosomes are copied, and the nuclear membrane disappearsB) nuclear membranes form around two sets of chromosomesC) spindle fibers pull the sister chromatids apartD) chromosomes condense, and mitotic spindles form