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
jok3333 [9.3K]
3 years ago
10

int sequence[10] = { 3, 4, 5, 6, 7, 8, 9, 10, 1, 2 }; Write a C++ program to ask the user to enter a number, if the number can b

e found in the array, your program should display "Found". Otherwise, your program should display "Not found". For example, if the user enters 7, your program should display "Found". If the user enters 11, your program should display "Not found".
Computers and Technology
1 answer:
Inessa [10]3 years ago
7 0

Answer:

The c++ program to implement search through an array is shown.

#include <iostream>

using namespace std;  

int main()  

{

   int sequence[10] = { 3, 4, 5, 6, 7, 8, 9, 10, 1, 2 };

   int input;

   int found = 0;

   cout << " This program confirms whether your element is present in the array. " << endl;

   cout << " Enter any number  " << endl;

   cin >> input;

   for( int k = 0; k < 10; k++ )

   {

       if( input == sequence[k] )

           found = found + 1;

   }

   if( found == 0 )

       cout << " Not Found " << endl;

   else

       cout << " Found " << endl;

   return 0;

}

OUTPUT

This program confirms whether your element is present in the array.  

Enter any number  

7

Found

Explanation:

The program uses the given integer array.

User is prompted to input any number. No validation is implemented for user input since it is not mentioned. The user input is taken in an integer variable, input.

int input;

cout << " Enter any number " << endl;

   cin >> input;

Another integer variable found is declared and initialized to 0.

int found = 0;

Inside for loop, each element is compared with the user input.

If the user input is present in the given array, variable found is incremented by 1.

for( int k = 0; k < 10; k++ )

   {

       if( input == sequence[k] )

           found = found + 1;

   }

If value of variable found is 0, program displays “ Not Found ”.

If the value of variable found is greater than 0, program displays “ Found ”.

if( found == 0 )

       cout << " Not Found " << endl;

   else

       cout << " Found " << endl;

This program can be tested for both positive and negative numbers.

You might be interested in
Type the correct answer in the box. Spell all words correctly.
Vanyuwa [196]

my guess would be HTML.

4 0
3 years ago
Refer to the exhibit, a technician applies the configuration in the exhibit to an unconfigured router. To verify the configurati
pentagon [3]

Answer:

E. Enable secret 5 $1$v0/3$QyQWmJyT7zCa/yaBRasJm0 enable password 7 14141E0A1F17 line console 0 password 7 020507550A

Explanation:

The cisco ios is the operating system of any cisci network device. It is a command line interface used to configure these cisco devices.

The privilege user command "show running-config" in the command line interface is used to show the current configuration on the RAM of the router.

There are two ways to protect the router's console line with a password, with enable secret and enble password. The "enable secret" is a slightly encrypted password but the "enable password" has no encryption. These password methods are used to secure any channel to the router.

The "service password-encryption" command is used to encrypt all the passwords in the current configuration, to prevent attackers or unauthorized users from getting to the router.

7 0
4 years ago
The smallest network
katrin [286]

Smaller networks include LANs or MANs.

Hope this is what you were looking for!

3 0
3 years ago
What are the first steps that you should take if you're unable to get onto the internet
zhenek [66]

Answer:

See below

Explanation:

  • Check the physical connections first.
  • Ethernet cable to PC and or router, and power cable / power status.
  • Next try to reboot the router and check lights status.
  • If everything is fine on your end then contact your internet provider to further troubleshoot on their end.
4 0
4 years ago
Read 2 more answers
Because log-on procedures may be cumbersome and tedious, users often store log-on sequences in their personal computers and invo
diamong [38]

Answer:(C) Anyone with access to the personal computers could log on to the mainframe.

Explanation:

It is no doubt that log on procedures are cumbersome so what most users do is that they store log on sequences in their computer so that they could use the main frame facilities whenever they access it the second time.

Here we have to identify the associated risk with this approach.

This process could lead to access of the computer system to users and thereby making all the data available in the system vulnerable. So option C is correct.

option (A) is incorrect as the back up option who also be affected when the system is accessible to anyone.

option (B) is incorrect because it has nothing to do anything with training of the personnel.

option (D) is incorrect because it one has nothing to do with the physical system what vulnerable reside is inside the system.

7 0
3 years ago
Other questions:
  • ________ computers are specially designed computer chips that reside inside other devices such as your car or the electronic the
    9·1 answer
  • Which combination of factors would result in the lowest monthly mortgage payment?
    9·2 answers
  • Which of the following is a valid format symbol in Microsoft Excel? Dollar Sign, Comma, Percent Sign or all of them? I can't fig
    14·1 answer
  • Clunker Motors Inc. is recalling all vehicles from model years 2001-2006. Given a variable modelYear write a statement that prin
    8·1 answer
  • Your organization's network has multiple layers of security devices. When you attempt to connect to a service on the Internet. H
    9·1 answer
  • Cpu coolers are typically made using what two different types of materials?
    6·1 answer
  • Write code that prompts for three integers, averages them, and prints the average. Make your code robust against invalid input;
    7·1 answer
  • No down payment, 18 percent / year, payment of $50/month, payment goes first to interest, balance to principal. Write a program
    9·1 answer
  • How do we benefit from this increased interconnectivity?
    6·1 answer
  • A hacker is trying to gain remote access to a company computer by trying brute force password attacks using a few common passwor
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!