Answer:
theSum = 0.0#defined in the question.
count=0 #modified code and it is used to intialize the value to count.
data = input("Enter a number: ") #defined in the question.
while data != "": #defined in the question.
number = float(data) #defined in the question.
theSum += number #defined in the question.
data = input("Enter the next number or press enter to quit ") #defined in the question "only some part is modified"
count=count+1#modified code and it is used to count the input to print the average.
print("The sum is", theSum)#defined in the question.
print("The average is", theSum/count) #modified code and it is used to print the average value.
output:
- If the user inputs as 1,4 then the sum is 5 and the average is 2.5.
Explanation:
- The above code is written in the python language, in which some part of the code is taken from the question and some are added.
- The question has a code that tells the sum, but that code is not print the average value of the user input value.
- To find the average, some codes are added, in which one count variable which is initialized at the starting of the program and gets increased by 1, when the user gives the value.
- Then that count divides the sum to print the average.
The resistance is 16 ohm's
V=I x R where V is the voltage, I is the current, and R is the resistance in Ohms
120= 15 x R
R=120/15
R= 8 Ohm's
P=VxV / R
P=120v x 120v / 8 ohms
P= 14400/8
P = 1800 watts
R = V x V/P
R = 14400/900
R = 16 Ohm's
The resistance is 16 ohm's:
I = V/R
I = 120/16
I = 7.5 Amps
Pull the other end of each cable through the back of the electrical box for the switch<span> that controls it, then strip the end of the cable with a knife and </span>separate<span> the </span><span>wires.
</span>
Answer:
here is code in C++.
#include <bits/stdc++.h>
using namespace std;
int main()
{
// variables to store number of each video
int new_video,old_video;
double total_charge;
cout<<"Please enter number of new video:";
// read number of new video
cin>>new_video;
cout<<"Please enter number of old video:";
// read number of old video
cin>>old_video;
// total change
total_charge=(3.0*new_video)+(2.0*old_video);
cout<<"total cost is: "<<total_charge<<endl;
return 0;
}
Explanation:
Declare two variables "new_video" and "old_video" to store the number of each type of video.Read the value of both from user.Then calculate total charge by multiply 3.0 to number of new video & 2.0 to number of old video and add both of them. This will be the total charge.
Output:
Please enter number of new video:4
Please enter number of old video:6
total cost is: 24
Answer:
the Internet Protocol (IP)