Answer:
Explanation:
the answer is also in the question. The loop is used to control the number of program execution. So in order not to run forever, the loop should be included inside the loop brackets. Then you can restructure the code as done below.
var numItems = promptNum("How many items?");
var total = 0;
var itemPrice=0;
while (numItems > 0){
itemPrice = promptNum("Enter next item price");
total = total + itemPrice;
numItems = numItems - 1;
}
console.log("The total is" + total);
The value to be displayed will be the total of the item prices inputted.
Answer:
a) Input: Energy entered
b) Conversion process: Applies action
c) Outputs: Information that is been taken out.
Explanation:
Hope it is right and helps.
A program is a list of commands that tell your computer what to do<span />
I can’t see the answer choices but I would like to say it’s JPEG am not sure. Could you at least provide the answer choices? Thanks!
I guess you need solution on C++. Here is the code:
int main () { double areaofsquare; double length cin >> areaofsquare;
<span>length = sqrt(areaOfSquare);
std::cout << length << std::endl;</span> if(areaofsquare >= 0) { sqrt(areaofsquare); cout << areaofsquare << endl; } else { cout << "INVALID" << endl; }
}