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
creativ13 [48]
3 years ago
7

R7.1 Carry out the following tasks with an array:

Computers and Technology
1 answer:
Andru [333]3 years ago
6 0

Answer:

Following are the program in the C++ Programming Language.

//set header file or namespace

#include <iostream>

using namespace std;

//define main function

int main() {

//set integer type array with indexing 10

 int a[10];

//set integer type variable to 1

 int i=1;

//set element in 1st index

 a[0]=17;

//set element in last index

 a[9]=29;

//set while loop for the remaining elements

 while(i<9)

 {

//set -1 in the remaining elements

   a[i]=-1;

   i++;

 }

//set for loop to print array

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

   cout << a[j]<<endl;

 }

}

<u>Output:</u>

17

-1

-1

-1

-1

-1

-1

-1

-1

29

Explanation:

In the following program, we define the main function "main()" and inside it.

  • Set an integer type array element "a[]" with index value 10.
  • Set integer data type variable "i" initialize to 1.
  • Set elements in the first and last place in the array.
  • Set the while loop to initialize elements for the remaining place.
  • Set the for loop to print the array elements.
You might be interested in
Select the term below which is a protocol that provides a method for software components to communicate, interact, and share dat
KATRIN_1 [288]

Answer:

B. Application programming interface

Explanation:

An application programming interface (API) is an interface or communication protocol between different parts of a computer program intended to simplify the implementation and maintenance of software. An API may be for a web-based system, operating system, database system, computer hardware, or software library.

8 0
2 years ago
A new attack involves hacking into medical records and then offering these records for sale on the black market. A medical recor
Flura [38]

Answer:

1. Control Activities

2. Internal

Explanation:

Considering the scenario explained in the question, it can be concluded that This is an IT application of the COSO principle of CONTROL ACTIVITIES and evidence PREVENTIVE controls.

In this case, the Control Activities which is one of the five principles of COSO (Committee of Sponsoring Organizations of the Treadway Commission) is a means of selecting and developing general control over technology, through strategies and techniques. This is what the medical records company did by building controls into its systems to prevent hackers from accessing its system.

This is an example of internal CONTROL ACTIVITIES that illustrates PREVENTIVE control against potential risks or hacks.

8 0
3 years ago
write an application to presell a limited number of cinema tickets. each buyer can buy as many as 4 tickets. No more than 100 ti
Rus_ich [418]

Answer:

The program for this question can be given as:

Program:

import java.util.*;  //import package

public class TicketSeller  //define class

{

public static void main(String ar[])  //main method

{

int totalTickets=100,userCount=0,remainingTickets=100,numTickets; // varaibale

try           //try block

{

Scanner ob= new Scanner(System.in);  //input by user

System.out.println("Total Tickets:"+totalTickets);

while(remainingTickets!=0)          //loop

{

System.out.print("Enter no of Tickets to buy:");      //message.

numTickets=ob.nextInt(); //taking input

if(numTickets<=4)         //conditional statements.

{

if(remainingTickets>=numTickets)

{

remainingTickets=remainingTickets-numTickets;              //calculate remainingTickets

userCount++;

System.out.println("remaining tickets : "+remainingTickets+" user :"+userCount);      

}

else

{

System.out.println("Invalid Input");

}

}

else

{

System.out.println("Invalid Input");

}

}

}

catch(Exception e)            //catch block.

{

}

}

}

Output:

Total tickets:100

Enter no of Tickets to buy: 4

Remaining tickets : 96 User :1

Enter no of Tickets to buy: 4

Remaining tickets : 92 User :2

Enter no of Tickets to buy: 4

Remaining tickets : 88 User :3

.

.

.

Enter no of Tickets to buy: 4

Remaining tickets : 0 User :25

Explanation:

In the above Program firstly we import the package for the user input. Then we declare the class that is (TicketSeller) given in question. In this class we declare the main method in the main method we declare the variable that is totalTickets, userCount, remainingTickets and numTickets .Then we use the exception handling. we use this for providing the validation from the user side that users don't insert value less the 4. In the exception handling, we use the multiple catch block with try block. Then we input from the user and calculate the values and in the last, we print all the values.

8 0
3 years ago
Your network employs basic authentication that centers on usernames and passwords. However, you have two ongoing problems. The f
Agata [3.3K]

Answer:

Using a one time password OTP and using a three factor authentication.

Explanation:

Social engineering is a form system and network attack, drafted by an attacker, to steal user credentials needed for accessing their accounts, to steal information.

Social engineering attacks like phishing, spear phishing, baiting and quid quo pro are used to fool users to giving out their user details.

One time password is an implied use of a password just once and a new password his generated to boost security. In a three factor authentication, OTP can be used as well as biometrics of a user which can not be giving away by a user to an attacker.

8 0
3 years ago
Es el conjunto de manifestaciones materiales, intelectuales y espirituales que distinguen a un pueblo a)Civilización b)Cultura c
GREYUIT [131]

Answer:

a)Civilización

Explanation:

3 0
2 years ago
Other questions:
  • Candace opened an email from a person she didn't know and clicked on a pop-up in the email that installed a virus on her compute
    8·2 answers
  • A/An ___ is a series of instructions or commands that computer follows used to create software
    10·2 answers
  • Choose the type of critical thinking demonstrated in the example:
    8·2 answers
  • The _______ of a secondary storage device indicates how much data the storage medium can hold.
    13·1 answer
  • Select one or more of the following: Which of these events will cause signal(s) to be generated by the kernel (the operating sys
    6·1 answer
  • Which of the following is a particularly useful feature of Microsoft PowerPoint and
    8·2 answers
  • When we code an algorithm, we need to provide the commands in the order we want the
    10·1 answer
  • Alvin has created a non-extensive site map of all the commonly visited pages of his website. What is such a site map called?
    13·1 answer
  • I need so much help, can anyone please help me?
    15·1 answer
  • NEED HELP QUICK!!!
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!