Java | JSP | JSF Answers

Questions answered by Experts: 3 611

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Create a class named Course_Details that will contain get and set methods for the course name,

student numbers and lecturer. In the Course_Details class include a method called Assign Venue

that will randomly generate a Venue/Class for the course. Venues can be from 1 to 3 only. Your

main class must include a static method to handle the printing of the course report.


A login JFrame Form:use NetBeans application

Functions:

1. Add a Book to the list with the given book id from a JTextField.

2.Display the image of a book cover with the given book id from a JTextField.

 Create 5 sample “book cover” image files (in jpeg format) in your Project folder. An example is shown below:

 You can create your own simple image files using a Paint program.

 The file name for book-1 is Book1Cover.jpg, for book-2 is Book2Cover.jpg, and so on.

3. List the books (book title and short description) with respect to the given author name from a JTextField.

4. List the books (book title) with respect to the given category from a JTextField.

5. List the books (book title) with respect to the given category from a JTextField, sorted by their rating.

6. Display the number of books that the user has finished reading in the given year from a JTextField.


(with GUI) developed with Java programming language.

Create a project named “FavoriteBooks” which keeps a list of the books that a user has read and liked.

This list is stored in a text document (.txt) file and for each book it keeps the following data separated by a comma (,):Book id, Title, Category, First Author Name and Surname, Award Winner, Rating, Year, Number of Pages, and Short Description.

A login JFrame Form:

Functions:

1. Add a Book to the list with the given book id from a JTextField.

2. Delete a Book from the list with the given book id from a JTextField. This task should delete the book with the given id from the text document. A message dialog box should be displayed to show that this task is completed.

3. Display the information of a book with the book title given fully or as a keyword from a JTextField..

Note: How you design the GUI (Graphical User Interface) of your project is optional.



Create a class named Course_Details that will contain get and set methods for the course name,

student numbers and lecturer. In the Course_Details class include a method called Assign Venue

that will randomly generate a Venue/Class for the course. Venues can be from 1 to 3 only. Your

main class must include a static method to handle the printing of the course report.


Sam runs a local musical equipment store in your neighbourhood. He has contracted you to create

an interactive application that will assist him with customer purchases. Create a class named

Customer Purchases that will contain get and set methods for a customer number, first name,

surname, product, price and quantity. Create a separate class called Printing that will include a

method called Print Details, that will print the Customer Invoice. In the Printing class include

another method called Customer Purchase Report which will display the following information:


Can we not use an object of the Parent Class in the Child Class and use all its features?


Q2

Consider the following classes:

public abstract class Cat {

private int age;

private double weight;

private double top_speed;

public void run(double newSpeed) { ... }

private void eat(double portionSize) { ... }

// ... -> getXXX() and setXXX() methods here } 

}

public class Cheetah extends Cat {

private String type;

public Cheetah(int age, double wt, double sp, String type) {

this.type = type;

setAge(age);

setWeight(wt);

setTopSpeed(sp);

}

private void run(double newSpeed) { ... }

public void camouflage() { ... } // ... ->

//

getXXX()

//

and setXXX() methods here }

}

Which design principles are violated by these classes? Explain it and then correct it



Consider the following classes:


public abstract class Cat {

      private int age;  private double weight;    private double top_speed;

     public void run(double newSpeed) { ... }

     private void eat(double portionSize) { ... }

// ... -> getXXX() and setXXX() methods here }  

}

public class Cheetah extends Cat {

 

 

}

private String type;

public Cheetah(int age, double wt, double sp, String type) {       this.type = type;  setAge(age);      setWeight(wt);       setTopSpeed(sp);

} private void run(double newSpeed) { ... }

public void camouflage() { ... } // ... ->

//    getXXX()

//    and setXXX() methods here }


Which design principles are violated by these classes? Explain it and then correct it

B. Identify a real-world scenario for the below task:6 A task where the next one to work on is always the one that has been waiting the longest. i. For the above task, explain your choice of an appropriate data structure for such a task. [3 marks] ii. Provide the corresponding algorithm for solving such a problem based on the data structure you chose above. You can represent each step diagrammatically. [5 marks


Using java, define a class student with the following specification Private members of class student: admno integer sname string eng, math, science of type float total of type float ctotal() //a function to calculate eng + math + science with float return type. Public member function of class student: Takedata() //Function to accept values for admno, sname, eng, science and invoke ctotal() to calculate total. Showdata() //Function to display all the data members on the screen.


LATEST TUTORIALS
APPROVED BY CLIENTS