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
Gnoma [55]
3 years ago
10

Define a function below, posodd_number_filter, which takes a single numerical argument. Complete the function to return accepted

if the input is positive and odd. Otherwise, return rejected.
Computers and Technology
1 answer:
Vaselesa [24]3 years ago
5 0

The program is an illustration of functions.

<h3>What are functions?</h3>

Functions are set of program statements that are executed when called or evoked.

<h3>The main program</h3>

The function written in Python, where comments are used to explain each line of the program is as follows:

#This defines the function

def posodd_number_filter(num):

   #This checks if the function is odd and positive

   if num >0 and num%2 ==1:

       #If yes, this returns Accepted

       return "Accepted"

   #If no, this returns Rejected

   return "Rejected"

Read more about functions at:

brainly.com/question/14284563

You might be interested in
What is the difference between spyware and adware?
Sati [7]

Answer:

It's C

Explanation:

Adware displays or directs the users to an advertisement, while spyware performs espionage on the computer`s activity.

8 0
3 years ago
Read 2 more answers
Infrastructure as a Service (IaaS) replaces the _________ of the computer hierarchy with an Internet-based infrastructure.
snow_tiger [21]

Answer:

Digital level logic through machine level

Explanation:

Infrastructure as a Service can be regarded as computing cloud services that allows computation, storage, server in the cloud.it helps the user to access infrastructure in the cloud

Digital level logic which is in digital circuit that allows boolen expression, it allows signals as well as sequence to be expressed in form of numbers, it is usually view as been complicated but not.

It should be noted that Infrastructure as a Service (IaaS) replaces the Digital level logic through machine level of the computer hierarchy with an Internet-based infrastructure.

5 0
3 years ago
Which behavior demonstrates teamwork
attashe74 [19]
Cooperation, agreements, trust Etc*
3 0
3 years ago
Read 2 more answers
1. The correct definition of ergonomics is: (a) The correct way to position your feet when in front of electronic equipment. (b)
fgiga [73]

Answer:

I'd assume it's C.

Explanation:

hope this helps!

6 0
3 years ago
Write a program that asks the user to input an integer named numDoubles. Create a dynamic array that can store numDoubles double
Hitman42 [59]

Answer:

Answered in C++

#include <iostream>

using namespace std;

int main() {

   int size;

   cout<<"Length of array: ";

   cin >> size;

   double *numDoubles = new double[size];

   double sum =0;

   cout<<"Array Elements: ";

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

       cin>>numDoubles[i];

       sum += numDoubles[i];

   }

   delete [] numDoubles;

   cout<<"Average: "<<sum/size;

   return 0;  

}

Explanation:

This line declares the size (or length) of the array

<em>    int size; </em>

This line prompts the user for the array length

<em>    cout<<"Length of array: "; </em>

This gets the input from the user

<em>    cin >> size; </em>

This dynamically declares the array as of double datatype

<em>    double *numDoubles = new double[size]; </em>

This declares and initializes sum to 0

<em>    double sum =0; </em>

This prompts the user for elements of the array

<em>    cout<<"Array Elements: "; </em>

The following iteration gets input from the user and also calculates the sum of the array elements

<em>    for(int i=0;i<size;i++){ </em>

<em>        cin>>numDoubles[i]; </em>

<em>        sum += numDoubles[i]; </em>

<em>    } </em>

This deletes the array

<em>    delete [] myarray; </em>

This calculates and prints the average of the array

<em>    cout<<"Average: "<<sum/size; </em>

6 0
3 years ago
Other questions:
  • Which Windows feature captures and stores copies of folders and files at specific points in time, allowing users or administrato
    10·1 answer
  • Which of these decisions would u most likely make on ur own
    8·2 answers
  • To display rows from one table that do not have a corresponding row in the other table, you must create a(n) ___________________
    10·1 answer
  • PLEASE HELP TAKING A TEST!!!
    10·2 answers
  • Anne-Marie Cole runs the sales division for a local auto insurance firm. One of her key duties is to calculate her company's mar
    13·1 answer
  • Which feature of a word processing program enables you to represent an text information in the form of a diagram?
    14·2 answers
  • Two ways in which the media does not reflect the society you live in.
    9·1 answer
  • C++
    11·1 answer
  • A collection of code makes up which of the following?
    14·2 answers
  • Define computer architecture?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!