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
Liula [17]
3 years ago
14

The Counter Pattern

Computers and Technology
1 answer:
kumpel [21]3 years ago
6 0
You'll probably see numbers counting up, like 1 2 3 4 ...
You might be interested in
Write Album's PrintSongsShorterThan() to print all the songs from the album shorter than the value of the parameter songDuration
lidiya [134]

Answer:

kindly check explainations for code

Explanation:

Check below for program code.

#include <iostream>

#include <string>

#include <vector>

using namespace std;

class Song

{

public:

void SetNameAndDuration(string songName, int songDuration)

{

name = songName;

duration = songDuration;

}

void PrintSong() const

{

cout << name << " - " << duration << endl;

}

string GetName() const { return name; }

int GetDuration() const { return duration; }

private:

string name;

int duration;

};

class Album

{

public:

void SetName(string albumName) { name = albumName; }

void InputSongs();

void PrintName() const { cout << name << endl; }

void PrintSongsShorterThan(int songDuration) const;

private:

string name;

vector<Song> albumSongs;

};

void Album::InputSongs()

{

Song currSong;

string currName;

int currDuration;

cin >> currName;

while (currName != "quit")

{

cin >> currDuration;

currSong.SetNameAndDuration(currName, currDuration);

albumSongs.push_back(currSong);

cin >> currName;

}

}

void Album::PrintSongsShorterThan(int songDuration) const

{

unsigned int i;

Song currSong;

cout << "Songs shorter than " << songDuration << " seconds:" << endl;

/* Your code goes here */

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

currSong = albumSongs.at(i);

if(currSong.GetDuration()<songDuration){

currSong.PrintSong();

}

}

}

int main()

{

Album musicAlbum;

string albumName;

getline(cin, albumName);

musicAlbum.SetName(albumName);

musicAlbum.InputSongs();

musicAlbum.PrintName();

musicAlbum.PrintSongsShorterThan(210);

return 0;

}

4 0
3 years ago
which two statements about incoming and outgoing interfaces in firewall policies are true? (choose two.)
Ratling [72]

The statements that are true regarding incoming and outgoing interfaces in firewall policies are:

  • A zone can be chosen as the outgoing interface.
  • -Multiple interfaces can be selected as incoming and outgoing interfaces.

<h3>What is a firewall?</h3>

A firewall is a network security device used in computing that monitors and regulates incoming and outgoing network traffic in accordance with pre-established security rules. Typically, a firewall creates a wall between a trustworthy network and an unreliable network, like the Internet.

A firewall aids in defending your network from intruders. A firewall protects your network by operating as a continuous filter that constantly scans incoming data and blocks anything that appears to be suspicious.

Therefore, the statements that are true regarding incoming and outgoing interfaces in firewall policies are:

A zone can be chosen as the outgoing interface.

-Multiple interfaces can be selected as incoming and outgoing interfaces.

Learn more about firewall on:

brainly.com/question/13693641

#SPJ1

Which statements are true regarding incoming and outgoing interfaces in firewall policies? (Choose two.)

Select one or more:

-An incoming interface is mandatory in a firewall policy, but an outgoing interface is optional.

-A zone can be chosen as the outgoing interface.

-Only the any interface can be chosen as an incoming interface.

-Multiple interfaces can be selected as incoming and outgoing interfaces.

4 0
1 year ago
How do headphones work? (From pc)
____ [38]
<span>Large headphones are essentially just two loudspeakers mounted on a strap that clamps firmly over your head. Earbuds work the same way but, as you would expect, everything inside them (the magnet, the coil of wire, and the diaphragm cone that makes sound) is shrunk down to a much smaller size.</span>
5 0
3 years ago
In addition to key executives, there are other positions in a company that may be considered critical, or whose loss will be dif
Otrada [13]

Answer:

Explanation:

Every employee who works for a company plays an important role in his field. some of the key employees of a company is sales representative, marketing executives, human resource managers, etc

whereas in manufacturing sector additional employees are developers, manufacturing workers, quality testers, etc, which when leaves a company, there is always a chance for the employee to join the competitors which is a threat to integrity of a company

Plus particular field becomes unstable for that time until a good employee hire again for the same position.

If a network administrator leaves, the company may suffer from their network issues. as a network administrator maintain networks, troubleshoot with any network problem, checks the security of the network and many more, he plays a very important role in the company.

If a sales representative leaves the job from the company, sometimes it results as a great loss of a company as a sales representative is in direct contact with customers, and when they leave a job there are chances that they carry the customer with them which results in loss of business.

5 0
2 years ago
The return value is a one-dimensional array that contains two elements. These two elements indicate the rows and column indices
erma4kov [3.2K]

Answer:

In Java:

import java.util.Scanner;  

import java.util.Arrays;  

public class Main  {  

public static void main(String args[])  {  

Scanner input = new Scanner(System.in);

int row, col;  

System.out.print("Rows: ");    row = input.nextInt();

System.out.print("Cols: ");     col = input.nextInt();  

int[][] Array2D = new int[row][col];

System.out.print("Enter array elements: ");

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

    for(int j =0;j<col;j++){

        Array2D[i][j] = input.nextInt();  

    }     }

 

int[] maxarray = findmax(Array2D,row,col);

System.out.println("Row: "+(maxarray[0]+1));

System.out.println("Column: "+(maxarray[1]+1));

}  

public static int[] findmax(int[][] Array2D,int row, int col)   {  

int max = Array2D[0][0];

int []maxitem = new int [2];

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

    for(int j =0;j<col;j++){

        if(Array2D[i][j] > max){  

            maxitem[0] = i;

            maxitem[1] = j; } }    }

 

return maxitem;  

}  

}

Explanation:

The next two lines import the scanner and array libraries

<em>import java.util.Scanner;   </em>

<em>import java.util.Arrays;   </em>

The class of the program

<em>public class Main  {  </em>

The main method begins here

<em>public static void main(String args[])  {  </em>

The scanner function is called in the program

<em>Scanner input = new Scanner(System.in);</em>

This declares the array row and column

int row, col;

This next instructions prompt the user for rows and get the row input  

System.out.print("Rows: ");    row = input.nextInt();

This next instructions prompt the user for columns and get the column input  

System.out.print("Cols: ");     col = input.nextInt();  

This declares the 2D array

int[][] Array2D = new int[row][col];

This prompts the user for array elements

System.out.print("Enter array elements: ");

The following iteration populates the 2D array

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

<em>     for(int j =0;j<col;j++){ </em>

<em>         Array2D[i][j] = input.nextInt();   </em>

<em>     }     } </em>

This calls the findmax function. The returned array of the function is saved in maxarray  

int[] maxarray = findmax(Array2D,row,col);

This prints the row position

System.out.println("Row: "+(maxarray[0]+1));

This prints the column position

System.out.println("Column: "+(maxarray[1]+1));

The main method ends here

}  

The findmax function begins here

public static int[] findmax(int[][] Array2D,int row, int col)   {  

This initializes the maximum to the first element of the array

int max = Array2D[0][0];

This declares maxitem. The array gets the position of the maximum element

int []maxitem = new int [2];

The following iteration gets the position of the maximum element

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

<em>     for(int j =0;j<col;j++){ </em>

<em>         if(Array2D[i][j] > max){  </em>

<em>             maxitem[0] = i; </em><em>-- The row position is saved in index 0</em><em> </em>

<em>             maxitem[1] = j;  </em><em>-- The column position is saved in index 1</em><em>} }    } </em>

This returns the 1 d array

return maxitem;  

}  

7 0
3 years ago
Other questions:
  • What is the role of the constructor for an object?
    5·1 answer
  • In what country did true printing first take place?
    12·2 answers
  • You have just driven to the Hewlett-Packard site in Corvallis to field-interview a programmer. You sit down in a conference room
    6·1 answer
  • How do i show all emails from same sender in outlook
    13·2 answers
  • To use the AutoCalculate area, select the range of cells containing the numbers for a calculation you want to verify and then pr
    7·1 answer
  • Convert each of the following base 10 &amp; base 2 numbers in signed magnitude, one’s complement and two’s complement. Each of t
    8·1 answer
  • How to program a game​
    7·2 answers
  • Privacy Group of answer choices must be respected if we are to function as complete, self-governing agents is an absolute value
    5·1 answer
  • Which of these is a negative effect of computer technology's role in creating
    9·1 answer
  • • Do you think documentaries are best delivered in media such as films or documentary?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!