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
Which type of cables are used for high-capacity trunk lines that provide main routes for telephone, cable, and internet communic
Naily [24]

Answer:

Fiber-optic cable

Explanation:

Before the cable industry transitioned to fiber-optic cables, for many years, the standard cables used for telephone, cable, and internet communications were coaxial cables. The transition was made possible because the architecture of the fiber-optic cable came with a higher capacity, more extensive bandwidth link. Unlike the coaxial or the twisted pair cable, the fiber-optic is made from glass strands that transmit light signals much quicker and to greater distances. This makes fiber-optic cables the fastest high capacity data transfer link than any other cables to ever exist.

3 0
3 years ago
Which of the following ensures that dropped packets are resent?
Agata [3.3K]

Answer:

TCP

Explanation:

Transmission control protocol ensures packets loss and performs retransmission

TCP works with Internet Protocol (IP)

TCP/IP defines how computers send data packets to each other.

TCP allows transmission of information in both the direction.

Bit rate :defines the rate at which bits are transferred from one place to another

7 0
3 years ago
Anyone know why my pc won’t start up I upgraded my ram and everything seems fine
ser-zykov [4K]

Answer:

RAM Slots

Explanation:

If you upgraded RAM then check if RAM is in correct slots according to the Motherboard Manual, i had the same issue when i replaced my RAM.

4 0
2 years ago
What purpose would the auto fill feature be most helpful for?
Deffense [45]

Answer:

Completing the items in a series

Explanation:

Auto fill is a function found in software and applications that allows you to input a range of numbers or characters in a specific range and finish the entry you began typing with the program.

AutoFill effectively helps you to build tablets more efficiently, allowing you to fill cells with a set of data quickly, It allows you to create whole columns or rows of data that are centered on other cells' values. Autofill is used in all the rows to fill out a specific feature.

6 0
3 years ago
Write a function named average_value_in_file that accepts a file name as a parameter and reads that file, assumed to be full of
noname [10]

def average_value_in_file(filename):

   f = open(filename)

   total = 0

   count = 0

   for x in f.read().splitlines():

       total += int(x)

       count += 1

   return total/count

print(average_value_in_file("input.txt"))

I used an input file that looks like this:

1

1

1

1

6 0
3 years ago
Other questions:
  • You are given a string of n characters s[1 : : : n], which you believe to be a corrupted text document in which all punctuation
    12·1 answer
  • Propose, two new, proudly South African ways, which you can visualize that the internet of things, can be used in at work to mak
    7·1 answer
  • Which type of chemical bonds are formed by sharing electrons?
    11·1 answer
  • HELP PLEASE
    5·1 answer
  • What is the part of the browser window that displays the content of the web page such as pictures and text called?
    10·1 answer
  • Discuss the importance of employee security awareness training. What innovative ways should company’s implement security trainin
    14·1 answer
  • How can you remove heat from a computer?
    10·1 answer
  • Write a MATLAB program to accomplish the following: Create two vectors, a and b, where vector a contains all positive integers l
    10·1 answer
  • What were the important developments that occurred in photography that facilitated the creation of motion pictures? Two critical
    6·1 answer
  • What is the best definition of a network?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!