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
zmey [24]
2 years ago
14

Write a program called array1.cpp file that use either regular for loop or range based for loop to display the contents of the a

rray test []. You can also write a function to display the contents of array. Submit your code array1.cpp to Blackboard.
Computers and Technology
1 answer:
ch4aika [34]2 years ago
7 0

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

void display(int array_test [], int n){

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

       cout<<array_test[i]<<" ";   }

}

int main(){

   int n;

   cin>>n;

   int array_test[n];

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

       cin>>array_test[i];

   }

   display(array_test,n);

   return 0;

}

Explanation:

This defines the display function

void display(int array_test [], int n){

This iterates through the array

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

This prints each element of the array

       cout<<array_test[i]<<" ";   }

}

The main begins here

int main(){

This declares n as integer; n represents the length of the array

   int n;

This gets input for n

   cin>>n;

This declares the array

   int array_test[n];

The following iteration gets input for the array

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

       cin>>array_test[i];

   }

This calls the display function to display the elements of the array

   display(array_test,n);

   return 0;

}

You might be interested in
Among object-oriented languages, one feature that varies considerably is whether the language allows multiple inheritance. C++ d
Amiraneli [1.4K]

Multiple inheritance causes Diamond problem which happens when:

Class A is parent of class B and C

Now when class D will be inherited from both Class B and C it will have all the members of class A and B which if same will confuse the compiler to import which one?

C++ solves it by using virtual keyword with them and thus telling the compiler which one to inherit.

Java has introduced the interface concept rather then allowing multiple inheritance.

4 0
3 years ago
Which type of password provides the highest level of permissions in bios?
OLEGan [10]
<span>Which type of password provides the highest level of permissions in bios? = Supervisor provides the highest level of permissions in the BIOS</span>
6 0
3 years ago
How to you compute for the total room sales​
Furkat [3]

Answer:

[checking question] - Error:

Please give complete/specific questions so more brainies will be able to help you! Check out what makes a great answer/question here: https://faq.brainly.com/hc/en-us/articles/360010136959-Answering-Guidelines ߷

7 0
3 years ago
What is thesql command to list the total sales by customer , month , and product, with subtotals by customer and by month and a
alexira [117]

Answer:

The answer is below

Explanation:

The the sql command to list the total sales by customer , month , and product, with subtotals by customer and by month and a grand total for all product sales is:

SELECT S.CUS_CODE, T.TM_MONTH, S.P_CODE,

SUM(S.SALE_UNITS*S.SALE_PRICE) AS "TOTSALES"

FROM DWDAYSALESFACT AS S INNER JOIN DWTIME AS T ON S.TM_ID =

T.TM_ID

GROUP BY S.CUS_CODE,T.TM_MONTH,S.P_CODE WITH ROLLUP;

4 0
2 years ago
What is the name of the virus that appears to be a legitimate program?
timurjin [86]
A virus or malware appearing/pretending to be a legitimate program is called a Trojan. 
3 0
3 years ago
Other questions:
  • IF YOU KNOW THE ANSWER TO THIS PLEASE ANSWER ASAP
    12·1 answer
  • Why does someone put 'human' at the end of their social media profile as a summary or description? I've seen this a lot online n
    15·1 answer
  • The rule of thumb that predicts that the number of transistors on a cpu will double every two years is called ________ law.
    7·1 answer
  • What is a specific naming convention important in regards to your file management system<br> ?
    7·1 answer
  • In symmetric key cryptosystem, assume that Alice and Bob have set up a common key Kab. This key is only known to Alice and Bob.
    12·1 answer
  • What have been three technological changes to photography in the past 200 years?
    10·1 answer
  • An insurance company utilizes SAP HANA for its day-to-day ERP operations. Since they can’t migrate this database due to customer
    5·1 answer
  • ____________ are the in – built functions that perform a particular pre – defined task when used in a computer program.
    13·1 answer
  • Drag each tile to the correct box.
    15·2 answers
  • Resource _____ let you view, manage, and automate tasks on multiple aws resources at a time.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!