473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

URGENT IMMEDIATE HELP PLEASE regarding writing a java program

Hi guys, I'm a student teacher at a high school in Washington D.C. and I've come across a slight problem. See, I'm a math major, but one of the computer science teachers just quit and they need me to fill the position. I have to write this program out by tomorrow and I've tried to learn basic java, but I have no idea how to do this assignment. Basically, I need an answer key for this class and the teacher before didn't leave one. I'm expected to hold the fort down for the next month and I have no idea how to do java. I'd be happy to send someone a check if they could do this program and send me the .java file within the next five hours.

This is the next assignment the teacher would have done and I am expected to continue his curriculum.

Project Specifications

1. Your program must be in a file named Proj2.java and your room class should be in a file called GuestRoom.java.
2. In GuestRoom.java you must declare instance variables for the roomNumber, bedType, number of beds, maximumOccupancy, nightlyRate, number (an int set to zero to start referring to the number of people in the room), numberOfNights (an int set to 0 to start), and occupant (a string set to the empty string to start).
3. You must implement a constructor method which takes five parameters that will be used to initialize the uninitialized instance variables (roomNumber, bedType, numberOfBeds, maximumOccupancy, and nightlyRate). You will also need to build accessor and mutator methods for all eight instance variable, and a toString method that returns a nicely formatted, multi-line description of the room. In toString(), you will need to create a NumberFormat object to print the nightly rate, so don't forget to import the NumberFormat class.
4. Processing Specifications:
* Your main program should start by creating and initializing 3 room objects. Use the following data for the 3 rooms:
o 103,"double", 2, 4, 89.99
o 205, "queen", 2, 4, 109.99
o 312, "king", 1, 2, 159.99
* Print out the information about each room. (toString)
* Change the occupant of the 1st room to "Mr. Fred Flintstone".
* Change the number of people in the 1st room to 1.
* Change the bedType in the 1st room to "queen".
* Change the occupant of the 3rd room to "Mr. Hugh Heffner"
* Change the number of people in the 3rd room to 2.
* Change the nightlyRate for the 3rd room to 199.99.
* Change the nightlyRate for the 1st room 129.99
* Change the nightlyRate for the 2nd room to 119.99
* Change the numberOfBeds to 1 for the 2nd room.
* Change the maximumOccupancy to 2 for the 2nd room.
* Change the numberOfNights to 3 for the 3rd room.
* Print out the new information for all three rooms. (toString)
* Print out the roomNumber, occupant and total charges (nightlyRate * numberOfNights (you may need a NumberFormat object here)) for room 3. (accessor methods)
* Print out the roomNumber and occupant for room 1 (accessor methods).
* End the program

Output Specifications

There is no keyboard interaction with this driver program so all you will get is output which should look like:

Room no: 103
Bed Type: double
Number of Beds: 2
Max occupancy: 4
Nightly Rate: $89.99
Occupant:
Number of People: 0
Number of Nights: 0


Room no: 205
Bed Type: queen
Number of Beds: 2
Max occupancy: 4
Nightly Rate: $109.99
Occupant:
Number of People: 0
Number of Nights: 0


Room no: 312
Bed Type: king
Number of Beds: 1
Max occupancy: 2
Nightly Rate: $159.99
Occupant:
Number of People: 0
Number of Nights: 0


Room no: 103
Bed Type: queen
Number of Beds: 2
Max occupancy: 4
Nightly Rate: $129.99
Occupant: Mr. Fred Flintstone
Number of People: 1
Number of Nights: 0


Room no: 205
Bed Type: queen
Number of Beds: 1
Max occupancy: 2
Nightly Rate: $119.99
Occupant:
Number of People: 0
Number of Nights: 0


Room no: 312
Bed Type: king
Number of Beds: 1
Max occupancy: 2
Nightly Rate: $199.99
Occupant: Mr. Hugh Heffner
Number of People: 2
Number of Nights: 3


312 Mr. Hugh Heffner $599.97
103 Mr. Fred Flintstone
Oct 8 '07 #1
2 1478
r035198x
13,262 8TB
You obviously have not read our site's posting guidelines yet.
We are all vey willing to help, but we only do so within the site's guidelines.
Oct 8 '07 #2
JosAH
11,448 Expert 8TB
I've seen that lame excuse before many times. I'll check the IP address.
edit: most likely the op posted from the William & May college. Let's see
if they've got a CS teacher ...

kind regards,

Jos
Oct 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Roy J | last post by:
Hello everyone:) My name is Roy, I am new to Java and I have problem regarding to arrays. if you have time and like to help, please help. I am trying to make a program to deal with prime...
0
by: CHRIS ALOZIE | last post by:
NIGERIAN TELECOMMUNICATION LIMITED. FEDERAL SECRETARIAT COMPLEX, GARKI, ZONE II ABUJA. E-MAIL: chrisalozie@uboot.com DATE:16th August 2003 REF:rf/ntl-fgn
2
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
1
by: MR | last post by:
Hi, it has been observed that when we try to instantiate a .Net dll for the first time in a session (e.g. from an exe in .Net), it takes almost 10 times compared to subsequent instantiations. ...
1
by: kommaraju | last post by:
iam a starter to db2 & jdbc.i have a servlet program which connects to ibm db2 using jdbc.when i run this using apache tomcat 4.1.34 , it is showing a error message of HTTP STATUS 500 my jdbc...
5
by: koonda | last post by:
Hi all, I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the...
1
by: ccarter45 | last post by:
I'm new to java and writing a program that accepts user input for a password and it has to meet the following requirements: 1. At least 6 characters long. 2. Leading character can't be a digit....
6
by: thijo | last post by:
public class Point { private int x; private int y; private int Number;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.