Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Need Help to Solve The 2 Question...

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Need Help to Solve The 2 Question...

    Hi everyone.. I very new in Java and with 0 knowledge.. Please help me to solve this question..
    QUESTION 1

    You are required to write an application called Customer Billing System. This system will calculate water usage charges for a month that has been imposed by Syarikat Air Selangor Berhad. This system will categorise users into residential users and industrial users and calculate the charges based on data entered by the user. Data needed are the type of customer (Residential or Industrial), past meter reading and current meter reading.

    Given the charge rate as follows:

    For Residential:
    0 – 15 m3 : RM 0.82 every m3
    15.1 – 40 m3 : RM 0.65 every m3
    40.1 m3 and above : RM 0.42 every m3
    Minimum charge is RM 5.00

    For Industrial:
    0 m3 and above : RM 1.47 every m3
    Minimum charge is RM15.00

    Instruction:
    The above application must be able to hold information for up to 5 customers. Use an array and repetition structure to store information about users such as type of customer, past meter reading, current meter reading and charges. Write a structured Java program to develop the above system by following the steps below:

    a) Prompt the user to input the type of customer, past meter reading and current meter reading. Next, get the difference between current meter reading and past meter reading.
    b) Separate them as either R/r for Residential or I/i for Industrial. You can use any one of the two selection structures.
    c) Calculate the charges based on rates given above. If there is no water consumption, the minimum charge will be imposed. You can use any one of the two selection structures.
    d) Display information about the type of customer, past meter reading, current meter reading and charges for each customer. Print the information in table format.


    QUESTION 2

    Create a class named Student (class definition program). The class contains:

    • Private attributes to store values of Student name, Student university and Student mark.
    • A method named initialize() to assign initial value to the Student name, Student University and Student mark as specified in the parameter.
    • A method named reverse() to display Student name in reverse order.
    • A method named determineKKHS() to determine if a student comes from Hulu Selangor Community College or not. This method will return true if the value in the object is equal to the specified value.
    • A method named determineGrade() to determine grade based on Student mark. This method will return grade of a student.
    • A method named toString() that returns a string description for the student.

    Given the grades according to marks:

    Mark Grade

    90 and above A
    70 – 89 B
    50 – 69 C
    0 – 49 D

    Create the class program that has main() method for execution. This program should create two Student objects and implement all methods listed in the Student class.

    Use your own creativity to implement all methods in Student class and design your interface interactively.


  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Need Help to Solve The 2 Question...

    any help? any clue for me getting started

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Need Help to Solve The 2 Question...

    Break each problem up into a list of simple problems and solve them one at a time.
    As you enter the code, compile and test often.
    If you don't understand my answer, don't ignore it, ask a question.

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Need Help to Solve The 2 Question...

    Double posted. I am locking this thread. Please read the responses in your other post thoroughly

Similar Threads

  1. Need Help to Solve The 2 Question...
    By pineman in forum Object Oriented Programming
    Replies: 4
    Last Post: June 1st, 2012, 09:43 AM
  2. cant solve the question by my self..
    By spydahmeen in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 15th, 2012, 07:47 AM
  3. How i can solve this question? help me please ...
    By thecraetiveman in forum Java Theory & Questions
    Replies: 49
    Last Post: May 8th, 2012, 02:43 PM
  4. please help solve this question
    By thatguy in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 29th, 2012, 06:53 PM
  5. using while to solve this question !
    By deathpain in forum Java Theory & Questions
    Replies: 2
    Last Post: November 19th, 2011, 04:46 PM