Numeric constant data type

Read our note on the data types of constants, the answer the following questions:

One of the following program snippets has a syntax error:

Dim tax, gross, net As Double
tax = 0.2 * gross

Dim tax, gross, net As Single
tax = 0.2 * gross
1. Which one has the syntax error?

2. How can you fix it?

(Be sure you have option strict on if you run a test).


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.