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
MAXImum [283]
3 years ago
5

print out the last even number from an array of integers, if there is no even number, then print out a sentence indicating so.

Computers and Technology
1 answer:
den301095 [7]3 years ago
6 0

Answer:

See the sample algorithm below.

Explanation:

array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 22];

function last_even(arr) {

    for( i = arr.length-1; i >= 0; i--) {

         if (arr[i] % 2 == 0) {

              console.log(arr[i]);

              break;

         }

         else {

              console.log("There is no even number!");

         }

    }

}

last_even(array);

You might be interested in
The ability to present an effective message with useful content is obviously important to a good _____ presentation.
Zina [86]

A successful oral presentation depends on your ability to communicate your ideas clearly and with relevant content.

<h3>What is an oral expression? </h3>
  • Oral presentations, often known as public speaking or just presentations, involve one or more speakers discussing a particular topic with an audience.
  • This seeks to provide information, amuse, educate, and/or make a point.
  • When the author speaks in front of other students, coworkers, or other interested groups to convey the results of years of expertise and research while outlining essential elements to success, the book is referred to as an example of oral presentation.
  • An oral presentation is one of the best venues for fusing verbal prowess with powerful nonverbal indicators to extend your communication.
  • It enables people to speak in front of a live audience with assurance about their thoughts and opinions.

To learn more about Oral presentation, refer to:

brainly.com/question/27326303

#SPJ4

7 0
2 years ago
Chegg A full bootstrap program Select one: a. may be infected by viruses. b. is stored in ROM to ensure to avoid any infection f
harina [27]

Answer:

Option b = "is stored in ROM to ensure to avoid any infection from viruses. "

Explanation:

In order to to understand the fundamentals of an Operating system in computer one needs to know what the bootstrap program is.

The BOOTSTRAP PROGRAM is first program that will run when the computer is switched on, thus the program( the BOOTSTRAP PROGRAM) will be the program to open the OPERATING SYSTEM.

The device in laptops and personal computers known as ROM is an acronym that stands for Read-Only Memory and it is a storage medium. Because of ROM inability to get Virus it is used in the storage of Bootstrap program.

8 0
3 years ago
Write a Java program that accepts an integer number from the user between 20 and 100. Next, divide the number by 12 and determin
Eddi Din [679]
Import java.util.Scanner;
class hola
{
public static void main(String[]args)
{
Scanner x=new Scanner(System.in);
int a=x.nextInt();
int b;
if(a>20&&a<100)
{
b=a%12;
if(b%2==0){
System.out.print("es par"+b);
}
else{
System.out.print("es impar"+b);
}
}
}

}
4 0
4 years ago
Given two complex numbers, find the sum of the complex numbers using operator overloading.Write an operator overloading function
Inessa05 [86]

Answer:

I am writing the program in C++ programming language.  

#include<iostream>  // to use input output functions

using namespace std;   // to identify objects like cin cout

class ProblemSolution {  //class name

private:  

// private data members that only be accessed within ProblemSolution class

int real, imag;

 // private variables for real and imaginary part of complex numbers

public:  

// constructor ProblemSolution() to initialize values of real and imaginary numbers to 0. r is for real part and i for imaginary part of complex number

ProblemSolution(int r = 0, int i =0) {  

real = r; imag = i; }  

/* print() method that displays real and imaginary part in output of the sum of complex numbers */

void print(){  

//prints real and imaginary part of complex number with a space between //them

cout<<real<<" "<<imag;}  

// computes the sum of complex numbers using operator overloading

ProblemSolution operator + (ProblemSolution const &P){  //pass by ref

          ProblemSolution sum;  // object of ProblemSolution

          sum.real = real + P.real;  // adds the real part of the  complex nos.

          sum.imag = imag + P.imag;  //adds imaginary parts of  complex nos.

//returns the resulting object

          return sum;       }  //returns the sum of complex numbers

};   //end of the class ProblemSolution

int main(){    //start of the main() function body

int real,imag;  //declare variables for real and imaginary part of complex nos

//reads values of real and imaginary part of first input complex no.1

cin>>real>>imag;  

//creates object problemSolution1 for first complex number

ProblemSolution problemSolution1(real, imag);  //creates object

//reads values of real and imaginary part of first input complex no.2

cin>>real>>imag;

//creates object problemSolution2 for second complex number

ProblemSolution problemSolution2(real,imag);

//creates object problemSolution2 to store the addition of two complex nos.

ProblemSolution problemSolution3 = problemSolution1 + problemSolution2;

problemSolution3.print();} //calls print() method to display the result of the //sum with real and imaginary part of the sum displayed with a space

Explanation:

The program is well explained in the comments mentioned with each statement of the program. The program has a class named ProblemSolution which has two data members real and imag to hold the values for the real and imaginary parts of the complex number. A default constructor ProblemSolution() which initializes an the objects for complex numbers 1 and 2 automatically when they are created.

ProblemSolution operator + (ProblemSolution const &P) is the operator overloading function. This performs the overloading of a binary operator + operating on two operands. This is used here to add two complex numbers.  In order to use a binary operator one of the operands should be passed as argument to the operator function. Here one argument const &P is passed. This is call by reference. Object sum is created to add the two complex numbers with real and imaginary parts and then the resulting object which is the sum of these two complex numbers is returned.  

In the main() method, three objects of type ProblemSolution are created and user is prompted to enter real and imaginary parts for two complex numbers. These are stored in objects problemSolution1 and problemSolution2.  Then statement ProblemSolution problemSolution3 = problemSolution1 + problemSolution2;  creates another object problemSolution3 to hold the result of the addition. When this statement is executed it invokes the operator function ProblemSolution operator + (ProblemSolution const &P). This function returns the resultant complex number (object) to main() function and print() function is called which is used to display the output of the addition.

4 0
4 years ago
Are the blank space around the edges of the page
Law Incorporation [45]

Answer:

The blank space around the edges of a sheet of paper — as with the page of a book — that surrounds the text is called the margin.

8 0
3 years ago
Other questions:
  • Should a social network own our social data? Is it an invasion of privacy for social networks to collect and use the information
    6·1 answer
  • How to calculate a pid controller
    8·1 answer
  • State two functions of windows environment​
    9·1 answer
  • What is working with others to find a mutually agreeable outcome?
    8·2 answers
  • Which technology provides a solution to IPv4 address depletion by allowing multiple devices to share one public IP address
    13·1 answer
  • 1. What is the difference between the wireless network that you provide to your customers versus the wireless network that you w
    5·1 answer
  • the ratio of length, breadth and height of a room is 4:3:1. If 12m^3 air is contained in a room, find the length , breadth and h
    14·1 answer
  • If there is an int/integer in a array, and the same int/integer comes at the same spot, does it cancel each other out or does it
    14·1 answer
  • Read the problem listed below. Formulate a Decomposition or Outline of the problem. Determine if you have seen this problem befo
    15·1 answer
  • I need help here thanks forever who helps
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!