作业帮 > 综合 > 作业

一道英文C++题,Assume your program needs to store the part number

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/14 11:25:06
一道英文C++题,
Assume your program needs to store the part number of an item and its cost.The part number contains only whole numbers in the range of 5000 to 8000.The cost of an item ranges from $1200 to $3500,the cost can contain a decimal place.In a piece of paper:
a.Write the appropriate declaration statements to create the necessary variables and initialize them to the appropriate value--either 0 or 0.0.
b.Write an assignment statement that assigns the value 5123 to the part number variable.
c.Write an assignment statement that assigns the value 2500.65 to the cost variable.
d.Write a statement that stores in the part number variable the value entered bu the user.
e.Write a statement that stores in the cost variable the value entered by the user.
假设你的程序需要保存一个商品的零件编号和价钱.零件编号范围是5000到8000的整数.商品的价格范围从$1200到$3500.价格可以带小数位.
在一张纸上:
a. 用出何时声明语句创建必要的变量并且初始化这些变量为合适的值--0或0.0
b. 用一个赋值语句把5123赋给零件编号变量
c. 用一个赋值语句把2500赋给价格变量
d. 写一个由用户输入值的保存零件编号变量的语句
e. 写一个由用户输入值的保存价格变量的语句