sahel65
پنج شنبه 23 اردیبهشت 1389, 21:54 عصر
دوستان با اینکه برنامه بنظرم ایراد نداره ولی از عدم وجود متد main در برنامه خبر میده!
میتونید بگید ایراد از کجاست؟
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2
{
class buliding
{
public int floors;
public int area;
public int occupants;
}
class buildingdemo
{
static void main()
{
buliding house = new buliding();
buliding office = new buliding();
int areaPP;
house.occupants = 400;
house.area = 2500;
house.floors = 2;
/////
office.occupants = 25;
office.area = 4200;
office.floors = 3;
areaPP = house.area / house.occupants;
Console.WriteLine("house has:\n" + house.floors +
"floors\n" + house.occupants +
"occupants\n" + house.area +
"total area\n" + areaPP + "area per person");
Console.WriteLine();
areaPP = office.area / office.occupants;
Console.WriteLine("office has:\n " + office.floors +
" floors\n " + office.occupants +
" occupants\n " + office.area +
" total area\n " + areaPP + " area per person");
}
}
}
میتونید بگید ایراد از کجاست؟
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2
{
class buliding
{
public int floors;
public int area;
public int occupants;
}
class buildingdemo
{
static void main()
{
buliding house = new buliding();
buliding office = new buliding();
int areaPP;
house.occupants = 400;
house.area = 2500;
house.floors = 2;
/////
office.occupants = 25;
office.area = 4200;
office.floors = 3;
areaPP = house.area / house.occupants;
Console.WriteLine("house has:\n" + house.floors +
"floors\n" + house.occupants +
"occupants\n" + house.area +
"total area\n" + areaPP + "area per person");
Console.WriteLine();
areaPP = office.area / office.occupants;
Console.WriteLine("office has:\n " + office.floors +
" floors\n " + office.occupants +
" occupants\n " + office.area +
" total area\n " + areaPP + " area per person");
}
}
}