Java

Need Help in Java Assignment?
We can help you if you are having difficulty with your Java Assignment. Just email your Java Assignment at admin@assignmentcache.com.
We provide help for students all over the world in Java Assignment.

Items 31 to 40 of 100 total

per page
Page:
  1. 2
  2. 3
  3. 4
  4. 5
  5. 6

Grid  List 

Set Ascending Direction
  1. Penn foster Graded Project 5 TicTacToe Game GUI Java

    Penn foster Graded Project 5 TicTacToe Game GUI Java

    Regular Price: $20.00

    Special Price: $15.00

    Penn foster Graded Project 5 TicTacToe Game GUI Java

    In this project, you'll create the GUI front-end for the TicTacToe game. This application will leverage the classes you wrote in the graded project for Lesson 3. You'll copy code from Graded Project 3 for this project.
    Figure 20 is a guide for the completed user interface.

    INSTRUCTIONS
    1. In NetBeans, create a new Java Application project named TicTacToeGUIGame.
    2. Copy the games.board package from the Lesson 3 project named BoardGameTester.
    - Right-click on the game.board package in the BoardGameTester project of the Projects pane panel.
    - Choose the Copy option from the context menu or use the keyboard shortcut CTRL+C.
    - Paste it in the TicTacToeGUIGame project using the Paste option in the context menu or the keyboard shortcut CTRL+V.
    Make sure to copy and paste the package in the Source Packages folder.
    3. In the Cell.java file, have the Cell class extend the JButton class. This action will ensure that each cell on the board has the look and feel of a standard Java button.
    4. Override the paintComponent method in the Cell class as follows:
    public void paintComponent(Graphics g) {
            //paint the basic button first
            super.paintComponent(g);
            int offset = 5;
            Graphics2D g2 = (Graphics2D) g;
            g2.setStroke(new BasicStroke(5));
            switch (content) {
                case NOUGHT:
                    g2.setColor(Color.RED);
                    //Draw O
                    g2.drawOval(offset, offset, this.getWidth()
                            - offset * 2, this.getHeight() - offset * 2);
                    break;
                case CROSS:
                    g2.setColor(Color.BLACK);
                    //Draw X
                    g2.drawLine(offset, offset, this.getWidth() - offset,
                            this.getHeight() - offset);
                    g2.drawLine(this.getWidth() - offset, offset, offset,
                            this.getHeight() - offset);
                    break;
            }
        }
    This code uses the enhanced Graphics2D class to set the stroke thickness to more than one pixel. The Oracle documentation provides more guidance on creating complex geometric shapes using the Graphics2D class at http://docs.oracle.com/javase/tutorial/2d/geometry/index.html. Remember to import the java.awt and javax.swing packages!
    5. In the Board.java file, have the Board class extend the JPanel class. This action will ensure that the board can lay out each cell and process its UI events.
    6. Make the following modifications to the Board constructor:
    public Board(int rows, int columns, ActionListener ah) {
    cells = new Cell[rows][columns];
    this.setLayout(new GridLayout());
    for( int r = 0; r < cells.length; r++ ) {
    for (int c = 0; c < cells[r].length; c++) {
    cells[r][c] = new Cell(r,c);
    this.add(cells[r][c]);
    cells[r][c].addActionListener(ah);
    }
    }
    }
    These changes will add each cell to the UI and assign an ActionListener object to each cell.
    Note: Remember to import the java.awt, java.awt.event, and javax.swing packages.
    7. In the TicTacToeGUIGame.java file, have the TicTacToeGUIGame class extend JFrame. This action will ensure that the game is hosted in a Java window.
    8. Import the games.board, java.awt, and javax.swing packages.
    9. Add the following code to the main method:
    SwingUtilities.invokeLater( new Runnable () {
    public void run() { new TicTacToeGUIGame(); }
    });
    10. Declare the following instance variables in TicTacToeGUIGame:
    private Board gb;
    private int turn;
    11. Add the following method to handle each turn:
    private void takeTurn(Cell c) {
    Mark curMark = (turn++ % 2 == 0)?Mark.NOUGHT
    : Mark.CROSS;
    gb.setCell(curMark,c.getRow(),c.getColumn());
    }
    12. Define the following constructor to create the board, provide the event listener, and display the board in the window:
    private TicTacToeGUIGame() {
    gb = new Board(3, 3, new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    Cell c = (Cell) ae.getSource();
    takeTurn(c);
    }
    });
    this.add(gb);
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    this.setTitle(“TIC-TAC-TOE”);
    this.setSize(300, 300);
    this.setVisible(true);
    }
    13. Compile and run the project. How did you do? Test to make sure that each button displays a nought or cross when clicked.

    Learn More
  2. Penn foster Graded Final Project TicTacToe Game GUI Java Player 1 Wins

    Penn foster Graded Final Project TicTacToe Game GUI Java

    Regular Price: $20.00

    Special Price: $15.00

    Penn foster Graded Final Project TicTacToe Game GUI Java


    In this project, you’ll finish the GUI version of the Tic-Tac-Toe game. This project will require you to rewrite the application logic found in the graded project for Lesson 2, but using object orientation this time. In the instructions, code will be referenced from the previous graded projects.


    Instructions
    1. In NetBeans, open the TicTacToeGUIGame project.
    2. In the TicTacToeGUIGame.java file, make the following changes to the TicTacToeGUIGame class:
    a. Add a new method named getOutcome that returns an Outcome enumeration. Use the winOrTie method in the Lesson 2 graded project as a guide.
    b. In the takeTurn method, use the getOutcome method to determine whether to continue the game.
    c. In the takeTurn method, display a dialog message that displays the winner or tie when the game ends.
    Optionally, you can clear the board and start a new game after it ends.
    Note: You can use the following method to display a dialog message in the current window:
    JOptionPane.showMessageDialog (this, "Both players tie.");
    3. Build and run the project. Verify it works as expected. Don’t be discouraged if it doesn’t run as expected right away. Try tracing your steps and using System.out.write statements to figure out where you went wrong.

    Learn More
  3. CMIS 141 Final Project Titanic

    CMIS 141 Final Project Titanic

    Regular Price: $20.00

    Special Price: $15.00

    CMIS 141 Final Project Titanic


    Design a Java application that will read a file containing data related to the passengers on the Titanic. The description of the file is shown below. The application should provide statistical results on the passengers including:
    a. Total number of passengers on the Titanic
    b. Total number of passengers who perished on the Titanic
    c. Total number of Passengers who survived the sinking of the Titanic
    d. Number of passengers who survived the sinking of the Titanic as a function of the passenger class (e.g. 1,2,3)
    e. Number of passengers who survived the sinking of the Titanic as a function of the passenger gender (e.g., male, female)
    f. A list of the names of passengers who paid greater than $200 for their tickets
    g. A list of the names of passengers who were less than 10 years old who survived the sinking of the Titanic
    h. A list of the names of passengers who were less than 10 years old who perished on the Titanic
    i. The count of the number of passengers as a function of the first letter of their last name. (e.g., A: 13, B:33)
    j. Additional statistical results you add to enhance the functionality


    The following are some design criteria and specific requirements that need to be addressed:
    a. Use command line arguments to send in the name of the Titanic file.
    b. Use a 2D array to store the Titanic data. (Hint: You will probably need to store the array as String values and then convert to other types as needed since some data is null)
    c. You should create at least 2 Java classes – Titanic and TestTitanic. You are welcome to create additional classes if you want to further separate the functionality.
    d. You should create separate methods for each of the required functionality. (e.g. getTotalPassengers() will return the total number of passengers on the Titanic.)
    e. A user-friendly and well-organized menu should be used for users to select which data to return. A sample menu is shown in run example. You are free to enhance your design and you should add additional menu items and functionality.
    f. The menu system should be displayed at the command prompt, and continue to redisplay after results are returned or until Q is selected. If a user enters an invalid menu item, the system should redisplay the menu with a prompt asking them to enter a valid menu selection
    g. The application should keep track of the elapsed time (in seconds) between once the application starts and when the user quits the program. After the program is exited, the 2 application should provide a prompt thanking the user for trying the Titanic program and providing the total time elapsed.
    Here is sample run:
    java TestTitanic Titanic.txt
    ********** Welcome to the Titanic Statistical Application **************************
    Enter the number of the question you want answered. Enter ‘Q’ to quit the program :
    1. How many passengers were on the Titanic?
    2. What percentage of passengers perished on the Titanic?
    3. What percentage passengers survived the sinking of the Titanic?
    4. What percentage of passengers survived for each of the three classes?
    5. What percentage of passengers survived as a function of gender?
    6. What specific passengers paid more than $200 for their tickets?
    7. What specific passengers who were less than 10 years old perished on the titanic?
    8. What specific passengers who were less than 10 years old survived the sinking of the titanic?
    9. For each letter in the alphabet, how many passengers last names started with that letter?
    Q. Quit the program
    Enter your selection: 1
    There were 1310 Passengers on the Titanic.


    Submission requirements:
    Your deliverables include all Java files (.java) and a single word (or PDF) document. The Java files should be named appropriately for your applications. Your word document should include screen shots showing the successful compiling and running of each application, and a detailed description of the test plan for each application. The test plan should include the input, expected output, actual output and if the test case passed or failed. Submit your files to the Final Project assignment area no later than the due date listed in the calendar.


    Titanic Data Description:
    The attached tab delimited file, named titanic.txt contains the known passengers on the Titanic. There are 5 fields included in the file in the order:
    Passenger class (1,2,3)
    Survived (1=yes, 0=no)
    Name (Passenger name)
    sex (male or female)
    age (some values are blank)
    fare (some values are blank)

    Learn More
  4. CMIS 141 Homework 3 HeadPhones Class

    CMIS 141 Homework 3 HeadPhones Class

    Regular Price: $20.00

    Special Price: $15.00

    CMIS 141 Homework 3 HeadPhones Class


    1. (25 points) Create a Java class named HeadPhones to represent a headphone set.
    The class contains:
    - Three constants named LOW, MEDIUM and HIGH with values of 1, 2 and 3 to denote the headphone volume.
    - A private int data field named volume that specifies the volume of the headphone. The default volume is MEDIUM.
    - A private boolean data field named pluggedIn that specifies if the headphone is plugged in. The default value if false.
    - A private String data field named manufacturer that specifies the name of the manufacturer of the headphones.
    - A private Color data field named headPhoneColor that specifies the color of the headphones.
    - getter and setter methods for all data fields.
    - A no argument constructor that creates a default headphone.
    - A method named toString() that returns a string describing the current field values of the headphones.
    - A method named changeVolume(value) that changes the volume of the headphone to the value passed into the method
    Create a TestHeadPhones class that constructs at least 3 HeadPhones objects. For each of the objects constructed, demonstrate the use of each of the methods. Be sure to use your IDE to accomplish this assignment.


    2. (25 points) Create your own Java class that represents your favorite musical instrument. Your musical instrument class should have at least 3 constants, 4 private data fields, getters and setters for each private data field, a toString() method, and two additional methods of your choice.
    Create a test class that constructs at least 3 of your musical instrument objects. For each of the objects constructed demonstrate the use of each of the methods. Be sure to use your IDE to accomplish this assignment. You can pick any instrument you want. When designing your class, think about what would make sense to describe and use the instrument.
    For example, if you selected a trumpet, you might need to provide the number of valves, the manufacturer, if the instrument is using a mute, and the volume or even notes the trumpet is playing. Make this your own creation and have fun with it.

    Learn More
  5. ITSD322 Unit 1 Java console program

    ITSD322 Unit 1 Java console program

    Regular Price: $15.00

    Special Price: $12.00

    ITSD322 Unit 1 Java console program


    Throughout this course, you will be learning about object-oriented programming and demonstrating what you learn by writing some programs in Java. The first step will be to install and integrated development environment (IDE) that will be where you will write and compile your programs. You will also write your first program using Java to show that you have correctly installed the IDE.
    The project instructions and deliverables are as follows:
    Download and install Java JDK and NetBeans IDE using the default installation options.
    Run the IDE, and take a screenshot.
    Create a console program that prompts the user to enter the name and address of their employer and position they hold or the name and address of their favorite restaurant and their favorite meal.
    Display this information on the screen, each on a separate line.
    Run your modified program and take a screenshot of the results.
    Create a document in Word, and add the following:
    Title page which includes: CourseNumber, CourseSection, CourseName, ProjectName (Unit 1 IP), StudentName and Date.
    Screen shots showing the IDE running.
    Screen shot showing the program's output.
    Create a zip that includes your project folder and Word document, and upload it to the course portal.

    Learn More
  6. ITSD322 Unit 2 Java console program

    ITSD322 Unit 2 Java console program

    Regular Price: $20.00

    Special Price: $15.00

    ITSD322 Unit 2 Java console program


    The first step in writing a software application is to determine the requirements. There is no value in writing a program that does not address the needs of the client. Requirements can be gathered in many ways, but ultimately, the requirements serve to document what the application should and should not do. After the requirements are written, the application design can be prepared, followed by the actual coding. For this project, you will gain some practice in the design phase of software development by designing a program that will meet a given set of requirements.
    Develop a console program that simulates a section of a restaurant menu. Each item will have a different price and your program should define at least ten (10) items. You will need to obtain an order from the user who should provide their menu selection along with quantity. The total cost for the meal must be calculated. The user will enter the amount of their payment ($10, $20, etc.). The program needs to calculate the amount due back to the user (payment minus total cost of meal).
    The project instructions and deliverables are as follows:
    Create a document in Word (name the design document yourName_Unit2.IP), and add the following:
    Title page
    Course number and name
    Project name
    Student name
    Date
    List the data items that must be stored and used by the program. Each data item should be given a name for reference. Develop a UML class diagram that illustrates the data items for your program.
    List the decisions the program must make. References to the data items in the previous step should be used where appropriate.
    Describe the flow of operation of the program by preparing pseudocode or a UML activity diagram. All key activities should be included, and references to the data items and decisions listed in the previous steps should be used.
    Create a zip that includes your project folder and Word document, and upload it to the course portal.

    Learn More
  7. ITSD322 Unit 3 Java AnimalInfo console program

    ITSD322 Unit 3 Java AnimalInfo console program

    Regular Price: $20.00

    Special Price: $15.00

    ITSD322 Unit 3 Java AnimalInfo console program


    So far, you have learned about design and how to create a simple Java application using an IDE. Now, you are going to gain some experience writing an object-oriented program with classes, objects, inheritance, and polymorphism. These terms sound complex, but you will find they are not difficult to use. You will be drawing on all the information you have gained, and this project will require some time, so start early, and pay attention to instructions.


    For this project, you will write a Java program that allows the user to select an animal from a menu and then display information about the animal.
    Create a new project in your IDE named "AnimalInfo."
    Create a class called "AnimalInfo" as the main class for the program.
    Create a class called "Animal" with a virtual method displayInfo().
    Create 3 classes inherited from Animal (one for each of your animals). Each of the inherited classes should override Animal.displayInfo() to display information about the animal. The information should just be a short description of the animal displayed to the screen.
    In the AnimalInfo.main) method, display a menu allowing the user to choose 1 of 3 animals or quit the program. The menu should accept input from the user and take the appropriate action and then repeat until the user selects the option to quit. Hint: Simple menus are easiest to implement if the user selects a letter or number for each menu item.
    When the user selects an animal, use the displayInfo() method of the appropriate class to display information about the selected animal.
    Use comments throughout your code demonstrating your understanding of each statement of code.
    Make sure the program runs correctly before submission.
    Create a zip that includes your project folder and Word document, and upload it to the course portal.

    Learn More
  8. Tracking Contributors Linked List Insertion Sort Java Program

    Tracking Contributors Linked List Insertion Sort Java Program

    Regular Price: $20.00

    Special Price: $15.00

    Tracking Contributors Linked List Insertion Sort Java Program


    Based on the new requirement from your boss to be able to search for contributor's name, you decide it will be good idea to have the data sorted. You will read the contributor information from a file provided; it is a common delimited (CSV) file. AS each record is read, create a sorted Linked List of the contributors using the insertion sort method. At this point, you no longer need to maintain the stack. Your design should include the following:


    Each contributor will have the following information:
    • Name: String; //the name of the contributor
    • City: String; //the city in which the contributor lives
    • Country: String; //the country in which the contributor lives
    • Phone: String; //the phone number for the contributor
    • Contribution: Double; //the amount of the contribution given by the contributor to the zoo
    • ID: Integer; //identifier key for future needs


    Contributor Functions/Methods:
    • Input constructor: //to accept a string for the name and additional information for each contributor(this should call the Add constructor to implement the sorted list)
    • Print constructor: //to print out the contributor data
    • Print All constructor: //to print the entire list of contributor names
    • Add constructor: //to traverse the linked list and find the proper location for adding the instance


    Deliverables:
    • A Fully Documented Program to load the data creating a sorted linked list.
    • A Test Plan to show how program runs and can be executed.
    • A screen shot showing that the program loaded the data. After the data is loaded perform a Print All showing the sorted list.

    Learn More
  9. Stacks and Queues using linked lists Flowchart and Java Code

    Stacks and Queues using linked lists Flowchart and Java Code

    Regular Price: $20.00

    Special Price: $15.00

    Stacks and Queues using linked lists Flowchart and Java Code


    Basic data structures such as arrays are not sufficient for some applications. In some cases, more advanced data structures are more suitable. In this assignment you will examine Stacks and Queues using linked lists. Complete the following:


    Create a flowchart to represent the Push and Pop operations for a Stack based on a linked list data structure.
    Create a flowchart to represent the Enqueue and Dequeue operations for a Queue based on a linked list data structure.
    Write the required Java code to implement either a Stack or a Queue data structure based on a linked list. The code should include the class constructors, the necessary properties, and methods to add and remove elements from the data structure. Do not use the built-in Java Stack class or the built-in Java Queue interface or the built-in Java linked list (you should create your own code for these classes).
    Please submit your assignment in a single MS Word document:


    Note: Diagrams created in separate programs should be copied and pasted into your document for submission.

    Learn More
  10. CIS355A Week 5 Practice Program Pizza FileIO

    CIS355A Week 5 Practice Program - Pizza File/IO

    Regular Price: $12.00

    Special Price: $10.00

    CIS355A Week 5 Practice Program - Pizza File/IO


    Class in this week's practice program, we are "stepping up our game" a bit and we are going to begin seeing a more complex, but more "real world" object oriented program structure, using a 3-tiered (business, presentation, data layer). The good news is that for the Pizza Practice program you are not going to start from scratch, and everything you are being asked to do in this program is demonstrated in the example Circle program.
    If you have any questions or need any help post a question in the Programming/Practice Help discussion in the Introductions and resource module.
    Start by downloading the attached "Week5_Pizza_FileIO_Shell.zip" program, unzip the program and open it up into Netbeans. The shell project will compile and execute, and even read a stream file and populate the list with data from a string file.


    Steps
    You are then asked to complete the following TODO action items:
    Review the FileStream Class and:
    1. in the readlist method add the statements to add a string to the array list
    2. in the writeData method add the statement to write the string to the file
    Review the PizzaFileIO class and:
    1. In the writeData method add code to add the missing order fields to the record
    2. In the readData method add code to add the missing fields to the order object
    Review the OrderList class
    1. In the remove method add statements to remove the order from the list
    2. In the save method add the statement to write the array list to the file.
    Graphical User Interface
    Update the given graphical user interface to:
    1. Save the list in the Order list to a file using both types of file I/O (streams and objects).
    2. Retrieve the list from the file and display the list
    3. Add a menu items Save Orders and Retrieve Orders
    4. Update retrieveOrders method to retrieve the list from the orderList object.
    See the following for a demonstration of the working program.


    Just a Hint
    The amount of code you actually have to write in this execises is no more than 20 lines of code and each TODO can be accomplished with a single line of code.

    Learn More

Items 31 to 40 of 100 total

per page
Page:
  1. 2
  2. 3
  3. 4
  4. 5
  5. 6

Grid  List 

Set Ascending Direction