expand icon
book Programming Logic and Design, Introductory 7th Edition by Joyce Farrell cover

Programming Logic and Design, Introductory 7th Edition by Joyce Farrell

النسخة 7الرقم المعياري الدولي: 1285225562
book Programming Logic and Design, Introductory 7th Edition by Joyce Farrell cover

Programming Logic and Design, Introductory 7th Edition by Joyce Farrell

النسخة 7الرقم المعياري الدولي: 1285225562
تمرين 3

If productCost and productPrice are numeric variables, and productName is a string variable, which of the following statements are valid assignments? If a statement is not valid, explain why not.

a. productCost = 100

b. productPrice = productCost

c. productPrice = productName

d. productPrice = "24.95"

e. 15.67 = productCost

f. productCost = $1,345.52

g. productCost = productPrice - 10

h. productName = "mouse pad"

i. productCost + 20 = productPrice

j. productName = 3-inch nails

k. productName = 43

l. productName = "44"

m. "99" = productName

n. productName = brush

o. battery = productName

p. productPrice = productPrice

q. productName = productCost

الحلول خطوة بخطوة
موثّق
like image
like image

الخطوة 1 من18

Here, the numeric variables are “productCost” and “productPrice”, and string variable is “productName”.

a.

The numeric variable can hold the values of digits. So, the numeric value “100” is assigned to numeric variable of “productCost”.

Therefore, the assignment statement “productCost = 100” is     <div class=answer> Here, the numeric variables are “productCost” and “productPrice”, and string variable is “productName”. a. The numeric variable can hold the values of digits. So, the numeric value “100” is assigned to numeric variable of “productCost”. Therefore, the assignment statement “productCost = 100” is   . .


الخطوة 2 من 18


الخطوة 3 من 18


الخطوة 4 من 18


الخطوة 5 من 18


الخطوة 6 من 18


الخطوة 7 من 18


الخطوة 8 من 18


الخطوة 9 من 18


الخطوة 10 من 18


الخطوة 11 من 18


الخطوة 12 من 18


الخطوة 13 من 18


الخطوة 14 من 18


الخطوة 15 من 18


الخطوة 16 من 18


الخطوة 17 من 18


الخطوة 18 من 18

close menu
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
cross icon