private static void Main(string[] args) { Inputwrapper iw = new Inputwrapper(); Hotel hotel = new Hotel(); City = iw.getString("City: "); Name = iw.getString("Name: "); Rooms = iw.getInt("Number of Rooms: "); Cost = iw.getDecimal("Cost: "); Year = iw.getInt("Year: "); Rating = iw.getInt("Star Rating: "); Console.WriteLine(Show()); }
public static int Main(string[] args) { Inputwrapper iw = new Inputwrapper(); Console.WriteLine("Enter -1 to terminate the program"); int year = iw.getInt("Enter year: "); string currentYear = DateTime.Now.Year.ToString(); while (year != -1) { //currentYear(); Console.WriteLine("Not a leap Year"); year = Convert.ToInt32(Console.ReadLine()); if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) { Console.WriteLine("{0} is Leap Year", year); } else { Console.WriteLine("{0} is not a Leap Year", year); } Console.ReadLine(); } return(0); }
static void Main(string[] args) { Inputwrapper iw = new Inputwrapper(); double annualPopIncrease; double estimatedPop; //Calculate world population growth each year till 75 years int currentPop = iw.getInt("Current World Poplulation: "); decimal growthRate = iw.getDecimal("Current Growth Rate % (e.g, 2.0 for 2%): "); int anticipatedWorldPoplulation; for (int count = 0; count <= 75; count++) { annualPopIncrease = ((growthRate / 100) * currentPop)) * count; estimatedPop = currentPop + annualPopIncrease; } }