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

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

    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);
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Challenging Problems..!

    Please Edit your post and wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.

    Do you have any specific questions? Please post your code and ask questions about the problems you are having.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: Challenging Problems..!

    Quote Originally Posted by rahul12321 View Post
    These are the problems that my teacher gave us as a challenge do u have a solution to it?
    If I do your work for you, will I also get your grade?

    Come on, please show a little evidence of effort first.

  4. #4
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: Challenging Problems..!

    I see that the poster has plastered this question all over the internet. If this poster showed as much initiative when it came to studying Java, he'd have mastered Java by now.

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

    Default Re: Challenging Problems..!

    This is a homework dump, and you've dumped this (and been banned from) other java sites. As a result I'm going to lock this thread.

    @rahul12321, you should become familiar with the academic policy at your institution - in the context you have posted, it appears you are phishing for someone to do this for you...I can guarantee that doing so will be considered cheating. If however, you have made a legitimate attempt, and are actually willing to try and learn, you should learn how to ask questions the smart way

Similar Threads

  1. 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
  2. MP3 problems
    By relion65 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: July 15th, 2011, 12:09 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