我试图找出正确的数据类型,然后将每个数据类型声明为变量 [英] I'm trying to figure out the right data type and then declare each of them into variables

查看:94
本文介绍了我试图找出正确的数据类型,然后将每个数据类型声明为变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

人的出生地
人的出生年份(1999)
车牌(AMXT 048)
人的年龄(21)
学生的mark(70.5)
产品成本(14.50)
人名(Amardeep)
人的确切身高(155.65)





我尝试过的事情:



老实说我不知道​​我是不是做得对,但我无法找出每个这些的正确的数据类型

我不理解数据类型以及诚实。希望有人在这里可以帮我提供数据类型如何声明它们。

解决方案

数据类型:

 person的出生地 - 字符串
人的出生年份(1999) - 存储日期:DateTime
车牌(AMXT 048) - 字符串
人员的年龄(21岁) - 根据出生日期计算。不要单独存放。
学生商标(70.5) - 双倍
产品成本(14.50) - 双倍或十进制
人名(Amardeep) - 字符串
人的确切身高(155.65) - double


我会这样做

人的出生地 - > string 
人的出生年份(1999年) - > int
牌照(AMXT 048) - > string
人的年龄(21岁) - > int
学生成绩(70.5) - > double
产品成本(14.50) - > double
人名(Amardeep) - > string
人的确切身高(155.65) - >双


Person’s place of birth
Person’s year of birth (1999)
License Plate ("AMXT 048")
Person’s age (21)
Student’s mark (70.5)
Cost of a product (14.50)
Person’s name ("Amardeep")
Person’s exact height (155.65)



What I have tried:

I honestly don't know if I'm doing it right but i cant figure out the right data type for each of these
I'm not understanding the data types as well to be honest. hoping someone here could help me with the data types an how to declare them.

解决方案

Data Types:

person’s place of birth                    - string
Person’s year of birth (1999)              - Store as Date of birth: DateTime
License Plate ("AMXT 048")                 - string
Person’s age (21)                          - Calculate from Date of Birth. Don't store separately.
Student’s mark (70.5)                      - double
Cost of a product (14.50)                  - double or decimal
Person’s name ("Amardeep")                 - string
Person’s exact height (155.65)             - double


I would do this way

Person’s place of birth -> string
Person’s year of birth (1999) -> int
License Plate ("AMXT 048") -> string
Person’s age (21) -> int
Student’s mark (70.5) -> double
Cost of a product (14.50) -> double
Person’s name ("Amardeep") -> string
Person’s exact height (155.65) -> double


这篇关于我试图找出正确的数据类型,然后将每个数据类型声明为变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆