75.7k views
1 vote
What data types would you use for the following fields: Price, phone number, street address, Zip code, and notes about product usage?

1 Answer

5 votes

Answer: Datatypes are used for the classification of the data which can be in the form of character, float, integer etc.The mentioned elements will have the following data type:-

  • Price:- price of any article will be a numerous value and also can be in decimal form.So, it will have the float data type.
  • Phone Number -it is a numerical value and cannot have decimal value.Thus it be a integer value, the data type will be "int".
  • Street address- The value will be in alphabetic order thus the datatype will be "string"Zip code- It is a numerical value with no presences of decimal.So, the datatype will be " int".

  • Noted about usage of product:- The list of product can have name of product, product price , product type as well.Thus for product type data type will be "string", product price will be in "float" and product name will be in "string "form

User Radu Caprescu
by
6.1k points