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
AfilCa [17]
2 years ago
7

Consider the function definition void Demo( int& intVal, float floatVal ) { intVal = intVal * 2; floatVal = float(intVal) +

3.5; } Suppose that the caller has variables myInt and myFloat whose values are 20 and 4.8, respectively. What are the values of myInt and myFloat after return from the following function call? Demo(myInt, myFloat);
Computers and Technology
1 answer:
Fynjy0 [20]2 years ago
5 0

Answer:

myInt=40

myFloat=4.8

Explanation:

First look at the function definition .It has two arguments intVal is passed by reference while floatVal is passed by value.So the changes done on the myInt variable will be reflected on the original argument because when a variable is passed by reference the the changes are reflected on the original argument but when a variable is passed by value the function created a duplicate copy of it and work on them so changes are not reflected on the original argument.So myInt will get doubled while myFloat will remain the same.

You might be interested in
Write a program that prompts the user to enter an equation in the form of 10 5, or 10-5, or 1*5, or 13/4, or 13%4. The program s
grandymaker [24]

Answer:

  1. equation = input("Enter an equation: ")
  2. if("+" in equation):
  3.    operands = equation.split("+")
  4.    result = int(operands [0]) + int(operands[1])
  5.    print(operands[0] + "+" + operands[1] + "=" + str(result))
  6. elif("-" in equation):
  7.    operands = equation.split("-")
  8.    result= int(operands [0]) - int(operands[1])
  9.    print(operands[0] + "-" + operands[1] + "=" + str(result))  
  10. elif("*" in equation):
  11.    operands = equation.split("*")
  12.    result = int(operands [0]) * int(operands[1])
  13.    print(operands[0] + "*" + operands[1] + "=" + str(result))  
  14. elif("/" in equation):
  15.    operands = equation.split("/")
  16.    result = int(operands [0]) / int(operands[1])
  17.    print(operands[0] + "/" + operands[1] + "=" + str(result))  
  18. elif("%" in equation):
  19.    operands = equation.split("%")
  20.    result = int(operands [0]) % int(operands[1])
  21.    print(operands[0] + "%" + operands[1] + "=" + str(result))

Explanation:

The solution code is written in Python 3.

Firstly prompt user to enter an equation using input function (Line 1).

Create if-else if statements to check if operator "+", "-", "*", "/" and "%" exist in the input equation. If "+" is found (Line 3), use split method to get the individual operands from the equation by using "+" as separator (Line 5). Output the equation as required by the question using string concatenation method (Line 6).  The similar process is repeated for the rest of else if blocks (Line 7 - 22).  

5 0
3 years ago
A misfire code is a type _______ diagnostic trouble code (DTC).
Gre4nikov [31]

A misfire code is a type A diagnostic trouble code.  

A type A misfire indicates impending catalyst damage and is the most serious type of misfire condition. If this type of misfire is detected, the MIL may flash once per second to notify the driver that the car needs immediate service as soon as possible. In addition, a DTC is set and a freeze frame data is stored.


6 0
2 years ago
Describe the basic features of the relational data model and discuss their importance to the end user and the designer. Describe
Mandarinka [93]

Answer:

The answer to this question can be described as follows:

Explanation:

Relational data model:

The use of data tables to organize sets of entities into relationships requires a relational data model. this model work on the assumption, which is a primary key or code, that is included in each table configuration. The symbol for "relational" data links and information is used by other tables.

Model Design:

This model is used for database management, it consists of structure and language consistency. It is design in 1969.

Importance of data model:  

This provides a common standard for processing the potentially sound data in machines, that was usable on almost any one device.  

Big Data:

It moves to locate new and innovative ways to handle large volumes of authentication tokens and to gather business insights when offering high efficiency and usability at an affordable cost at the same time.

6 0
3 years ago
Write a program that asks the user to input a set of floating-point values. When the user enters a value that is not a number, g
Lady_Fox [76]

Answer:

Check the explanation

Explanation:

// include the necessary packages

import java.io.*;

import java.util.*;

// Declare a class

public class DataReader

{

// Start the main method.

public static void main(String[] args)

{

// create the object of scanner class.

Scanner scan = new Scanner(System.in);

// Declare variables.

boolean done = false;

boolean done1 = false;

float sum = 0;

double v;

int count = 0;

// start the while loop

while (!done1)

{

// start the do while loop

do

{

// prompt the user to enter the value.

System.out.println("Value:");

// start the try block

try

{

// input number

v = scan.nextDouble();

// calculate the sum

sum = (float) (sum + v);

}

// start the catch block

catch (Exception nfe)

{

// input a character variable(\n)

String ch = scan.nextLine();

// display the statement.

System.out.println(

"Input Error. Try again.");

// count the value.

count++;

break;

}

}

// end do while loop

while (!done);

// Check whether the value of count

// greater than 2 or not.

if (count >= 2)

{

// display the statement on console.

System.out.println("Sum: " + sum);

done1 = true;

}

}

}

}

Sample Output:

Value:

12

Value:

12

Value:

ten

Input Error. Try again.

Value:

5

Value:

nine

Input Error. Try again.

Sum: 29.0

3 0
3 years ago
Read 2 more answers
A thick black line around the outside edge of a page is a _____.
Montano1993 [528]
B. Border. It borders the outer page.
7 0
3 years ago
Read 2 more answers
Other questions:
  • What important information is added to the TCP/IP transport layer header to ensure communication and connectivity with a remote
    13·1 answer
  • which virtue you need to secure information by limiting computer access to authorized personnel only?
    10·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    7·1 answer
  • ​open-source software is​ ________.
    11·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
  • Processor is used to process the data.<br>A)true <br>B)False​
    13·1 answer
  • 2. Which Interface uses
    7·1 answer
  • In what way, if any, has community building changed in the age of digital media? People’s community building has not changed in
    13·1 answer
  • Write in language C, please.
    8·1 answer
  • Magnetic video tape in a plastic casing is a?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!