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
Lelechka [254]
3 years ago
7

Write a statement to declare and initialize an array of int named denominations that contains exactly six elements. Your declara

tion statement should initialize the elements of the array to the following values: 1, 5, 10, 25, 50, 100. (The value 1 goes into the first element; the value 100 to the last.)
Computers and Technology
1 answer:
lawyer [7]3 years ago
7 0

Answer:

// here is statement in C++ to declare and initialize an array.

int denominations[]={1, 5, 10, 25, 50, 100};

Explanation:

In C++, an array can be declare and initialize in a single statement.Syntax to declare and initialize an array in C++ is type <type> <name>[]={val1,vale2...valn}. Here first literal is type of array and second is name of the array.And in the {} braces value of the array.In the above statement type is integer and name of the array is "denominations" and the values are 1,5,10,25,50,100.

//here is implementation in C++.

// include headers

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// declare and initialize array

int denominations[]={1, 5, 10, 25, 50, 100};

return 0;

}

You might be interested in
What is the value of y when this code executes?
Cerrena [4.2K]

Answer:

The operation of 6*x only executes if x is greater or equal to 0, since x=-10 and -10 is less than 0, the operation does not execute. For this reason,  the value of y using this code is None.

Explanation:

In python a function is defined with the syntaxis:  

def function(x):  

the operation to execute (x)

value to return

In this case, the function is foo and the parameter is x:  

def foo(x):

  if x>= 0:

     return 6*x

The code starts by assigning a value to x. Then, the code asks if the value of x is grater or equal to 0, if this condition is meet, then the code returns the value of 6 times x, if not, then the code does not return a value. In this case, x is -10 and this value is not grater or equal to 0. Given that the condition is not met, then the code stops executing and the value of y is none.

4 0
2 years ago
Suzanne is following a fad diet. She has started to experience low energy during her workouts, and on a recent trip to the docto
Nastasia [14]

Answer:

Hi mate....

Explanation:

This is ur answer....

<em>-</em><em>-</em><em>></em><em> </em><em>Suzanne just facing low carbohydrates</em>....

hope it helps you,

mark me as the brainliest pls....

Follow me!

5 0
2 years ago
Read 2 more answers
What is the benefit of working with a ready-to-use cloud based AI vendor service?
nasty-shy [4]

Answer:

Explanation:

A cloud model allows organizations to purchase only the storage they need – when they need it – eliminating traditional infrastructure expenses. With this model, an organization can use these cost savings for AI development

7 0
2 years ago
Write a program that dynamically allocates an array large enough to hold a user-defined number of test scores. Once all the scor
Anastasy [175]

Answer:

// Program written in C++

// Comments are used to explain some lines

#include <iostream>

#include <iomanip>

using namespace std;

// Functions

void getData(double *, int);

void selectionSort(double *, int);

double getAverage(double *, int);

void displayData(double *, int, double);

int main() //Main Method

{

double *ToTest, // To dynamically allocate an array

Average; // To hold the average of the scores

int Scores; // To hold number of scores

// Get number of scores

cout << "Number of average to find? ";

cin >> Scores;

// Allocate an array to number of scores

ToTest = new double[Scores];

getData(ToTest, Scores);

selectionSort(ToTest, Scores);

Average = getAverage(ToTest, Scores);

printData(ToTest, Scores, Average);

return 0;

}

//Get Data

void getData(double *ToTest, int Scores)

{

cout << "Enter each scores.\n";

for (int i = 0; i < Scores; i++)

{

do

{

cout << "Score #" << (i + 1) << ": ";

cin >> *(ToTest + i);

if (*(ToTest + i) < 0)

{

cout << "Scores must be greater than 0.\n"

<< "Re-enter ";

}

} while (*(Test + i) < 0);

}

}

// Selection Sort

void selectionSort(double *ToTest, int Scores)

{

int startscan, minIndex;

double minValue;

for (startscan = 0; startscan < (Scores - 1); startscan++)

{

minIndex = startscan;

minValue = *(ToTest + startscan);

for (int i = startscan + 1; i < Scores; i++)

{

if (*(ToTest + i) < minValue)

{

minValue = *(Test + i);

minIndex = i;

}

}

*(ToTest + minIndex) = *(ToTest + startscan);

*(ToTest + startscan) = minValue;

}

}

// Calculate Average

double getAverage(double *ToTest, int Scores)

{

double Total;

for (int i = 0; i < Scores; i++)

{

Total += *(ToTest + i);

}

return Total / Scores;

}

// Print Data

void printData(double *ToTest, int Scores, double Avg)

{

cout << "\n Test scores\n";

cout << "Number of scores: " << Scores << endl;

cout << "Scores in ascending-order:\n";

for (int i = 0; i < Scores; i++)

{

cout << "#" << (i + 1) << ": " << *(ToTest + i) << endl;

}

cout << fixed << showpoint << setprecision(2);

cout << "Average score: " << Avg << endl;

}

6 0
2 years ago
A(n) ________ is a wonder of miniaturization combining a CPU, GPU, and sundry other support logic onto a single silicon die, sav
erma4kov [3.2K]

Answer:

system on a chip (SoC)

Explanation:

4 0
2 years ago
Other questions:
  • this weekend you areplanning to complete part of your assignment at the library to do this you need to store data on a removable
    10·1 answer
  • Someone please help! Please fill this out
    10·1 answer
  • With ____ editing, Word automatically displays a Paste Options button near the pasted or moved text.
    14·1 answer
  • Which of the following represent emerging classes of application software? Check all of the boxes that apply.
    9·3 answers
  • Upon looking out at the
    8·2 answers
  • What is the difference between line art and continuous tone copy?
    14·1 answer
  • Write a program that prompts the user to input five decimal numbers. The program should then add the five decimal numbers, conve
    5·1 answer
  • An IP address in the form 197.169.100.1 is called a(n) ________. dotted quad encryption key random number sequential access numb
    7·1 answer
  • A user reports that nothing happens when he or she attempts to print from the computer at his desk. This points to a possible pr
    15·1 answer
  • In binary, the second digit from the right is multiplied by the first power of two, and the _____ digit from the right is multip
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!