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:
Computer systems consist of three components as shown in below image: Central Processing Unit, Input devices and Output devices. Input devices provide data input to processor, which processes data and generates useful information that's displayed to the user through output devices. This is stored in computer's memory.
Answer:
Transmission Control Protocol (TCP)
Explanation:
On the network architecture for connecting to the internet, the output intended to be sent over the internet by an application are split into packets and pushed for delivery by one of two protocols; TCP or User Datagram Protocol
These protocols are also responsible for taking the messages contained in the packets for onward delivery to the relevant application via ports
However, TCP gathers and arranges the received packets in the correct order as the originally sent message as well as requesting the retransmission of packets that are damaged or lost from the sending server so as to include their payloads in order to complete the original message.
Answer:
A
Explanation:
Option A is not true because a Boolean variable type can hold one of two values only that is (true/True or false/False).
All the other options given in the question are correct because
- A variable declaration refers to specifying its type and name
- If string variables are assigned a numeric values which is legal provided the values are enclosed in quaotes( " "), trying to carryout a mathematical operation like addition will result in string concatenation.
- The Variable name I_Love_to_eat_pizza is legal because it contains no special characters, doesn't start with a number and its not a reserved word in any language
word = whatever value you want.
if "mold" in word:
print("Mold is in the variable word.")
else:
print("Mold is not in the variable word.")