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
Mnenie [13.5K]
3 years ago
6

Given the function definition void something ( int a, int& b ) { int c; c = a + 2; a = a* 3; b = c + a; } what is the output

of the following code fragment that invokes something? (All variables are of type int.) r = 1; s = 2; t = 3; something(t, s); cout << r << ' ' << s << ' ' << t << endl;
Computers and Technology
1 answer:
timurjin [86]3 years ago
8 0

Answer:

1 14 3

Explanation:

If that code fragment is put under a main() function and then it will yield the above output. According to the function something(), only changes in value second parameter will be reflected and first will be unchanged because second is passed by reference and the first one is passed as value so only address of 's' is passed, so, only its value is changed and the rest are same.

You might be interested in
Create a new Java project/class called ChangeUp. Create an empty int array of size 6. Create a method called populateArray that
-Dominant- [34]
<h2>Answer:</h2><h2></h2>

//import the Random and Scanner classes

import java.util.Random;

import java.util.Scanner;

//Begin class definition

public class ChangeUp {

   

   //Begin the main method

  public static void main(String args[]) {

       //Initialize the empty array of 6 elements

      int [] numbers = new int [6];

       

       //Call to the populateArray method

       populateArray(numbers);

       

       

   } //End of main method

   

   

   //Method to populate the array and print out the populated array

   //Parameter arr is the array to be populated

   public static void populateArray(int [] arr){

       

       //Create object of the Random class to generate the random index

       Random rand = new Random();

       

       //Create object of the Scanner class to read user's inputs

       Scanner input = new Scanner(System.in);

       

       //Initialize a counter variable to control the while loop

       int i = 0;

       

       //Begin the while loop. This loop runs as many times as the number of elements in the array - 6 in this case.

       while(i < arr.length){

           

           //generate random number using the Random object (rand) created above, and store in an int variable (randomNumber)

           int randomNumber = rand.nextInt(6);

       

           //(Optional) Print out a line for formatting purposes

           System.out.println();

           

           //prompt user to enter a value

           System.out.println("Enter a value " + (i + 1));

           

           //Receive the user input using the Scanner object(input) created earlier.

           //Store input in an int variable (inputNumber)

           int inputNumber = input.nextInt();

           

           

           //Store the value entered by the user in the array at the index specified by the random number

           arr[randomNumber] = inputNumber;

           

           

           //increment the counter by 1

          i++;

           

       }

       

       

       //(Optional) Print out a line for formatting purposes

       System.out.println();

       

       //(Optional) Print out a description text

      System.out.println("The populated array is : ");

       

       //Print out the array content using enhanced for loop

       //separating each element by a space

       for(int x: arr){

           System.out.print(x + " ");

       }

   

       

  } //End of populateArray method

   

   

   

} //End of class definition

<h2>Explanation:</h2>

The code above is written in Java. It contains comments explaining the lines of the code.

This source code together with a sample output has been attached to this response.

Download java
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
0d7446bcb6b48f78b8adbfa3da89789c.png
3 0
2 years ago
Shadow and highlight create depth (3D).<br> TRUE OR FALSE
tamaranim1 [39]

Answer:

true because then it would be like not popping out

7 0
2 years ago
What is the correct html element for playing video files?
Neko [114]
HTML stands for Hyper Text Markup Language. It is the most commonly language used for <span>creating web pages and web applications. </span>

<span>The correct HTML element for playing video files is <video>.
</span>

To show a video in HTML, use the <video> element:

Example:<span><video<span> width="320" height="240" controls</span>></span>
  <span><source<span> src="video 1.mp4" type="video/mp4"</span>></span>
  <span><source<span> src="movie.ogg" type="video/ogg"</span>></span>
<span></video<span>></span></span>
4 0
2 years ago
Read 2 more answers
Teaching Siri or the Google Assistant how to recognize your voice by reading to it is an example of ________.
nata0808 [166]

Answer:

4. Supervised learning.

Explanation:

Supervised and Unsupervised learning are both learning approaches in machine learning. In other words, they are sub-branches in machine learning.

In supervised learning, an algorithm(a function) is used to map input(s) to output(s). The aim of supervised learning is to predict output variables for given input data using a mapping function. When an input is given, predictions can be made to get the output.

Unsupervised learning on the other hand is suitable when no output variables are needed. The only data needed are the inputs. In this type of learning, the system just keeps learning more about the inputs.

Special applications of supervised learning are in image recognition, speech recognition, financial analysis, neural networking, forecasting and a whole lot more.

Application of unsupervised learning is in pre-processing of data during exploratory analysis.

<em>Hope this helps!</em>

8 0
2 years ago
Under what driving conditions will 2019 Nissan LEAF’s available Rear Cross Traffic Alert (RCTA) warn the driver if a vehicle is
Dmitriy789 [7]

Answer:

When the driver is <em>reversing the car</em>

Explanation:

The Rear Cross Traffic Alert (RCTA) is Nissan's <em>risk  of collision detector</em> that warns drivers if one or more cars are approaching the rear of your car when backing up from a parking space.  

Sensors around the back of the vehicle identify vehicles drawing nearer from the either way. A notice tone and glimmering light will appear and  alert the driver to stop.  

5 0
2 years ago
Other questions:
  • a supermarket having a sale on canned foods' the sale includes 12 cans of soup for 10.65 what is the unit price per can of soup
    6·2 answers
  • Whats the difference between copying a file to my desktop and creating a shortcut?
    8·1 answer
  • PLEASE HELP
    6·1 answer
  • What type of cable would you use to connect two hosts together in a back-to-back configuration using twisted pair cable?
    15·1 answer
  • The multitasking, multi-user, operating system developed by Bell Laboratories that operates on a wide variety of computing platf
    13·1 answer
  • How is the cia triad used to evaluate encryption methods?
    6·1 answer
  • Create a static method called fillArray, which takes an integer array as an input parameter, along with an integer initial value
    12·1 answer
  • . How to insert Section Break in Microsoft word 2016 ?
    14·1 answer
  • Select the correct answer. Who takes care of the final layout of the product that meets the standards set by UX designers? A. we
    15·1 answer
  • Which part of the computer is responsible for managing memory allocation for all applications
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!