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