Question: 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

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

Step by Step Solution

3.26 Rating (178 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a This statement is legal because numeric variables behave like numbers not strings So this statement puts the numeric value into the cost variable b ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Logic & Design Comprehensive Questions!