CurvedSpace Forums: Suite.java - CurvedSpace Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • {lang:pm_locked} This topic is locked

Suite.java

#1 {lang:macro__useroffline}   Neraphym {lang:icon}

  • Do not want!
  • Icon
  • {lang:view_blog}
  • Group: Super Moderator
  • Posts: 10,332
  • Joined: 29-October 03

Posted 06 March 2006 - 02:22 AM

// Chris Ray
// Chapter 8
// Problem 3

//Import java.io

public class Suite extends HotelRoom
{
public static void main(String[] args) throws IOException
{
//Buffer Reader

int Room = 0;
int Nights = 0;
int Cost = 0;

System.out.println("Enter Room Number:\t");
// Read Room Number

System.out.println("Enter Number of Nights:\t");
// Read Nights

Room Cell = new Room(Room);

int Rate = Cell1.getRoomRate(Room);
int Surcharge = Cell1.getSurcharge(Room)

Cost = Rate * Nights;

Cost = Cost + Surcharge;

System.out.println("Room: " + Room);
System.out.println("Cost: " + Cost);

}

int getSurcharge(int Num)
{
int charge = 0;

if(Num > 399)
{
charge = 40;
}
else
{
charge = 0;
}

return charge;
}
}
Neraphym Archaeon
Posted Image
GWAMM
0

Page 1 of 1
  • You cannot start a new topic
  • {lang:pm_locked} This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users