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 3 of 3

Thread: Challenging Problems..!

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

    Default Challenging Problems..!

    These are the problems that my teacher gave us as a challenge do u have a solution to it?
    Use appropriate notations
    ECLIPSE PREFERRED..
    Prog-1(a) Define a Question class which stores a multiple choice question having one correct
    answer. Each question has a complexity (difficulty) level. Use the Question class to define a
    Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz
    class to add a question to a quiz. Define the giveQuiz method of the Quiz class to present each
    question in turn to the user, accept an answer for each one, and keep track of the results.
    Define a class called QuizTime with a main() method that follows a menu based approach to
    populates a quiz, presents it by asking questions randomly, and prints the final results.
    (b) Modify your program so that the complexity level of the questions given in the quiz is taken
    into account. Overload the giveQuiz method so that it accepts two integer parameters that
    specify the minimum and maximum complexity levels for the quiz questions and only presents
    questions in that complexity range. Modify the main() method to demonstrate this feature.


    Prog-2 The People Bank can handle up to 30 customers who have savings accounts. Design and
    implement a program that manages the accounts. Keep track of key information and allow each
    customer to make deposits and withdrawals. Each withdrawal is charged with some fee.
    Produce appropriate error messages for invalid transactions.



    [Hint: you may want to base your
    Account and Bank objects with following definitions]
    public class Account {
    private long acctNumber;
    private double balance;
    privateCustomer customer;
    public double deposit (double amount);
    public double withdraw (double amount, double fee);
    public double getBalance ();
    public long getAccountNumber ();
    }
    public class Bank {
    private Account[ ] accounts; //Instead of Array, you may use Vector or ArrayList to store accounts
    public void createAccount (long accNumber, double balance, String cname);
    public double deposit (long accNumber, double amount);
    public double withdraw (long accNumber, double amount, double fee);
    public void deleteAccount (long accNumber);
    }
    Last edited by rahul12321; August 27th, 2012 at 09:00 AM. Reason: ECLIPSE PREFERRED..


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

    Default Re: Challenging Problems..!

    Please don't post the same question in more than one section.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    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: Challenging Problems..!

    Duplicate of http://www.javaprogrammingforums.com...-problems.html
    Thread locked

Similar Threads

  1. Challenging Problems..!
    By rahul12321 in forum Java Theory & Questions
    Replies: 4
    Last Post: August 27th, 2012, 02:55 PM
  2. Challenging Java Question: Test your Java skill by grouping these terms
    By karthickk3 in forum Java Theory & Questions
    Replies: 3
    Last Post: July 18th, 2012, 10:10 PM
  3. 2 problems...
    By Day2Day in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 22nd, 2010, 02:51 PM
  4. [SOLVED] Have a few odd problems.
    By javapenguin in forum What's Wrong With My Code?
    Replies: 18
    Last Post: October 19th, 2010, 06:08 PM
  5. non preemptive scheduling.....challenging!!
    By snehil2009 in forum Java Theory & Questions
    Replies: 0
    Last Post: November 8th, 2009, 03:07 AM