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]
3 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]3 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
Does anyone take bca on plato
SVETLANKA909090 [29]
I do. do you need help with it?
7 0
3 years ago
And what way do you mixed and market economy support the ideals of democracy​
PolarNik [594]
Mixed and market economies protect individuals' ability to make their own economic decisions.
5 0
3 years ago
While in slide show mode, if you are not careful you can close the application by clicking the x on the menu bar
sergejj [24]
When in slide show mode, the menu bar and that "x" are not visible.
5 0
3 years ago
Read 2 more answers
Give a big-O estimate for the number of comparisons used by the algorithm that determines the number of 1s in a bit string of le
Illusion [34]
The notation would be O (n-1) because there would be no need to compare with the first bit however this notation is most commonly noted as O (n) but the first is also technically correct
3 0
3 years ago
Read 2 more answers
Write a Python 3 program to read from a .csv file containing rates from power companies. Your program should determine the avera
aliya0001 [1]

Answer:

In python:

file = open("rates.csv", "r")

ratecount = 0

ratesum = 0

mylist = []

rates = file.readlines()

for nums in rates:

     num = nums.rstrip('\n')

     mylist.append(int(num))

     for i in num:

           ratesum= ratesum + int(i)

           ratecount = ratecount + 1

print("Maximum Rate: "+str(max(mylist)))

print("Minimum Rate: "+str(min(mylist)))

print("Average Rate: "+str(ratesum/ratecount))

Explanation:

This opens the csv file

file = open("rates.csv", "r")

This initializes the number of rates in the file

ratecount = 0

This initializes the sum of the rates

ratesum = 0

This initializes an empty list

mylist = []

This reads the rates into lines

rates = file.readlines()

This iterates through the rates (as a string)

for nums in rates:

This removes the newline character \n in the rates

     num = nums.rstrip('\n')

This appends the rates (as an integer) to the empty list

     mylist.append(int(num))

The following counts the rates in the file and also sum them up

<em>      for i in num: </em>

<em>            ratesum= ratesum + int(i) </em>

<em>            ratecount = ratecount + 1 </em>

This prints the maximum of the rates

print("Maximum Rate: "+str(max(mylist)))

This prints the minimum of the rates

print("Minimum Rate: "+str(min(mylist)))

This calculates and prints the average rate

print("Average Rate: "+str(ratesum/ratecount))

6 0
3 years ago
Other questions:
  • How many host ip addresses are available on a network with a subnet mask of 255.255.255.192?
    6·1 answer
  • When employees are hired, they agree to only use cell phones during breaks. How would you classify this?
    13·2 answers
  • WILL UPVOTE NEED ANSWERS ASAP i have till 4:30
    12·1 answer
  • You are configuring a switch that has three hosts attached to FastEthernet 0/2 through 0/4. All three hosts are part of a public
    10·1 answer
  • Please write a code for below:
    9·1 answer
  • I get such an error when I turn on the computer, how can I fix it?
    7·1 answer
  • 20.
    8·1 answer
  • What are the different Stape of data processing cycle?​
    8·1 answer
  • Ayuda pliz es para ya!!!!!<br> nesesito un codigo html que me muestre este texto
    8·1 answer
  • Animals living in burrows under the ground is an interaction between the biosphere and the
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!