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
larisa86 [58]
2 years ago
10

Write a program that uses an initializer list to store the following set of numbers in an array named nums. Then, print the arra

y. 14 36 31 -2 11 -6 Sample Run [14, 36, 31, -2, 11, -6] (In edhesive please)

Computers and Technology
2 answers:
dem82 [27]2 years ago
5 0

Answer:

nums=[14, 36, 31, -2, 11, -6]

print(nums)

Explanation:

I got a 100%

rodikova [14]2 years ago
4 0

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

    int nums[6] = {14, 36, 31, -2, 11, -6};

    cout<<"[";

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

    cout<<nums[i];

    if(i != 5){cout<<", ";}

    }

    cout<<"]";

   return 0;

}

Explanation:

This initializes the array

    int nums[6] = {14, 36, 31, -2, 11, -6};

This prints the opening square bracket

    cout<<"[";

This iterates through the array

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

This prints individual elements of the array

    cout<<nums[i];

Until the last index, this line prints comma after individual array elements

<em>     if(i != 5){cout<<", ";}</em>

    }

This prints the closing square bracket

    cout<<"]";

You might be interested in
Which one is correct?
VashaNatasha [74]

The top right answer

8 0
2 years ago
Read 2 more answers
You are working on a ticketing system. A ticket costs $10. The office is running a discount campaign: each group of 5 people is
cupoosta [38]

Answer:

Explanation:

The following program is written in Java. It takes 5 inputs of int values for the ages of each member in the group. Then it loops through all of the ages and chooses the youngest age. Finally, it applies that age as a discount to the final price which would be $50, outputting the final discounted price. The output for the test case provided can be seen in the attached picture below in red.

import java.util.Scanner;

class Brainly

{

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int[] person = new int[5];

       System.out.println("Enter age of individual 1: ");

       person[0] = in.nextInt();

       System.out.println("Enter age of individual 2: ");

       person[1] = in.nextInt();

       System.out.println("Enter age of individual 3: ");

       person[2] = in.nextInt();

       System.out.println("Enter age of individual 4: ");

       person[3] = in.nextInt();

       System.out.println("Enter age of individual 5: ");

       person[4] = in.nextInt();

       int youngest = person[0];

       for (int x = 0; x < person.length; x++) {

           if (person[x] < youngest) {

               youngest = person[x];

           }

       }

       double discount = 1 - (((double)youngest) / 100);

       double output = 50 * discount;

       System.out.println("Total Price: " + output + " the youngest is " + youngest);

   }

}

8 0
2 years ago
List 1 reason people invest in Cryptocurrency
Katarina [22]

Answer:

The common reason to invest in cryptocurrency is the desire for a reliable, long-term store of value.

Explanation:

8 0
2 years ago
___ are controls through which a user can enter input data in a gui application. answer
BaLLatris [955]
Digital data<span>. Biometric </span>data<span>. Digital </span><span>data</span>
5 0
3 years ago
Hi there! I am writing a code to make a square using a drone, however I’m having trouble doing so. The website that I’m writing
Jlenok [28]

Answer:

i might

Explanation:

3 0
2 years ago
Other questions:
  • Which elements in a web page require a visitor’s action?
    15·1 answer
  • Write a program to input money in cents from user, example 12745 and display the one dollar bills and the cents. Submit source c
    12·1 answer
  • Text that does not fit in a cell
    7·1 answer
  • If you are a member of a security penetration testing team, and you identify vulnerabilities and exploits, what should you obtai
    11·1 answer
  • What is alfred anderson in creole?
    6·1 answer
  • The function below takes two parameters: a string parameter: csv_string and an integer index. This string parameter will hold a
    5·1 answer
  • Why do computers use binary code?
    12·2 answers
  • OI MINHA PRIMEIRA VEZ AQUI
    7·1 answer
  • Four examples of computer virus​
    10·1 answer
  • Desktop computers have a(n) ________ unit, located within the system unit, that plugs into a standard wall outlet, converts AC t
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!