answersLogoWhite

0


Best Answer

String is not appropriate for that. While it is possible to store a number in a string, additional conversions need to be done if you need the number for calculations. Instead, use an integer data type (if no decimals are required), or a real data type (if decimals are required). In Java, for example, you could use int (no decimals) or double (allows decimals).

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What data type is string is suited to represent cost of a car?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What data type is is suited to represent cost of a car?

"float" should be sufficient


Where string is primitive data type of string data type?

String is not primitive data. Only char,int,double,and boolean are!


Why you use string s in the java program?

Strings are used to represent text data. This lets you work with names and other variables that hold text.


What three different data types you would in find in data base?

Number, string, binary string.


A text string contains a string of text?

text data


Can you store non primitive data type in the array list?

Yes you can store non primitive data type variables in an array. String is a non primitive data type. You can declare a string array as: String a[]=new String[10];


Is string is primitive or user defined data type?

String - is primitive data typestring - is user defined data type


What is in string?

A string is a collection of words or characters in '' or "" it is also a data type.


What is a connection string used for in computers?

A connection string in computing is a string that specifies how to connect to a data source and information about the data source. It is commonly used in database files.


What is string in Python?

A string is a collection of words or characters in '' or "" it is also a data type.


Is string arr a non primitive data type?

Depends on the context of the question you were asking from, there are 2 distinct answers: Yes and NO. In the narrowest definition, any array is NOT a primitive data type in C#. Hence a string array is NOT a primitive data type in that context. A string itself, however, is a primitive data type. Some developers would like to extend the definition of "primitives" into the arrays, collections, and Enumeration. Thus, in this context, an array of string IS a primitive data type.


Is String is a linear data structure?

yes