问题 解答题

某家具厂有方木料90m3,五合板600m2,准备加工成书桌和书橱出售.已知生产每张书桌需要方木料0.1m3,五合板2m2,生产每个书橱需要方木料0.2m2,五合板1m2,出售一张方桌可获利润80元,出售一个书橱可获利润120元.怎样安排生产可使所得利润最大?最大利润为多少?

答案

解:

设生产书桌x张,书橱y个,利润总额为z元.………………1分

z=80x+120y.  ………………………………3分

在直角坐标平面内作出上面不等式组所表示的平面区域,即可行域.

……………………………………………5分

作直线l:80x+120y=0,即直线l:2x+3y=0.

把直线l向右上方平移至l1的位置时,直线经过可行域上的点M,

此时z=80x+120y取得最大值.…………………7分

∴当x=100,y=400时,zmax=80×100+120×400=56000(元).………10分

因此,生产书桌100张、书橱400个,可使所得利润最大最大利润为56000元

本试题主要考查了线性规划的最优解问题,研究实际问题中的利润最大的运用试题,首先是作出可行域满足的不等式组,然后作图,平移得到结论。

问答题

请使用“答题"菜单或使用VC6打开考生文件夹proj1下的工程proj1。此工程包含程序文件main.cpp。程序中位于每个//ERROR************found************下的语句行有错误,请加以更正。更正后程序的输出应该是:
1958年3月23日比2001年11月5日更早
2001年11月5日比1958年3月23日更晚
2001年11月5日与2001年11月5日是同一日期
注意:只能修改每个//ERROR************found************下的那一行,不要改动程序中的其他内容。
//源程序
#include <iostream>
using namespace std;
class Date
int year;
int month;
int day;
public:
//ERROR************found************
Date(int yyyy, int mm, int dd): yyyy(year),mm(month),dd(day)
bool isLaterThan(Date dt) const //当前日期晚于日期dt时返回true
if(year!=dt.year) return year>dt.year;
if(month!=dt.month) return month>dt.month;
return day>dt.day;

bool isEarlyThan(Date dt) const //当前日期早于日期dt时返回true
if(year!=dt.year) return year<dt.year;
if(month !=dt.month) return month<dt.month;
//ERROR************found************
return day>dt.day;

void showDate() const cout<<year<<"年"<<month<<"月"<<day<<"日";

//ERROR************found************
void compareDate(Date dt1 Date dt2) const
if(dt1.isLaterThan(dt2))
dt1.showDate();cout<<"比";dt2.showDate();cout<<"更晚"<<endl;

else if(dt1.isEarlyThan(dt2))
dt1.showDate();cout<<"比";dt2.showDate();cout<<"更早"<<endl;

else
dt1.showDate();cout<<"与";dt2.showDate();cout<<"是同一日期"<<endl;


int main()
Date dt1(1958,3,23),dt2(2001,11,5);
compareDate(dt1,dt2);
compareDate(dt2,dt1);
compareDate(dt2,dt2);
return 0:

单项选择题