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 41 to 50 of 100 total

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

Grid  List 

Set Ascending Direction
  1. Penn foster Graded Project 3 Cell-based Board Games Java

    Penn foster Graded Project 3 Cell-based Board Games Java

    Regular Price: $20.00

    Special Price: $15.00

    Penn foster Graded Project 3 Cell-based Board Games Java

    In this project, you'll create data types in a class structure for cell-based board games similar to Tic-Tac-Toe. Games like Connect Four and Mastermind also use boards divided by rows and columns. The Board and Cell classes represent the board, while the Player, Mark, and Outcome enumerations track the game.
    You’ll use the classes and enumerations created in this project in future graded projects. You use the NetBeans project in the next lesson

    INSTRUCTIONS
    1. In NetBeans, create a new Java Application project named BoardGameTester.
    2. Create a new package named games and a sub-package of games named board. The easiest way is simply to create a package named games.board.
    3. Add an enumeration named Player to the games.board package. You could add Empty Java File or choose Java Enum as the file type. This enumeration represents the current player in a turn-based game. Use the following code:
    public enum Player {FIRST,SECOND}
    Note: Although Tic-Tac-Toe and Mastermind allow only two players, Connect Four can be played with up to four players. For simplicity, our code will handle only two players.
    4. Add an enumeration named Outcome to the games.board package. This enumeration represents the result when the turn is completed. Use the following code:
    public enum Outcome {PLAYER1_WIN, PLAYER2_WIN, CONTINUE, TIE}
    5. Add an enumeration named Mark to the games.board package. This enumeration represents the result when the game is completed. Use the following code:
    public enum Mark {EMPTY, NOUGHT, CROSS, YELLOW, RED, BLUE, GREEN, MAGENTA, ORANGE}
    Keep in mind that only yellow and red are used in Connect Four, while Mastermind uses all six colors.
    6. Add the Cell class to the games.board package. It should have the private variables content, row, and column, and the public methods getContent, setContent, getRow, and getColumn. Use the following code as a guide:
    public class Cell {
    private Mark content;
    private int row, column;
    public Cell(int row, int column) {
    this.row = row;
    this.column = column;
    content = Mark.EMPTY;
    }
    public Mark getContent() { return content; }
    public void setContent(Mark content) { this.content = content;
    }
    public int getRow() { return row; }
    public int getColumn() { return column; }
    }
    Take note that all classes that support direct instantiation should have a constructor. In this case, the constructor will be used by the Board class to create each of its cells.
    7. Add the Board class to the games.board package. It should have a two-dimensional array of Cell objects. The Board class should initialize a board with a specified number of columns and rows, provide access to Cell objects, and display all of its cells correctly. Use the following code as a guide:
    public class Board {
    private Cell[][] cells;
    public Board(int rows, int columns) {
    cells = new Cell[rows][columns];
    for( int r = 0; r < cells[0].length; r++) {
    for (int c = 0; c < cells[1].length;c++) {
    cells[r][c] = new Cell(r,c);
    }
    }
    }
    public void setCell(Mark mark, int row, int
    column) throws IllegalArgumentException {
    if (cells[row][column].getContent() == Mark.EMPTY)
    cells[row][column].setContent(mark);
    else throw new IllegalArgumentException("Player already there!");
    }
    public Cell getCell(int row, int column) {
    return cells[row][column];
    }
    public String toString() {
    StringBuilder str = new StringBuilder();
    for( int r = 0; r < cells.length; r++ ) {
    str.append("|");
    for (int c = 0; c < cells[r].length; c++) {
    switch(cells[r][c].getContent())
    {
    case NOUGHT:
    str.append("O");
    break;
    case CROSS:
    str.append("X");
    break;
    case YELLOW:
    str.append("Y");
    break;
    case RED:
    str.append("R");
    break;
    case BLUE:
    str.append("B");
    break;
    case GREEN:
    str.append("G");
    break;
    case MAGENTA:
    str.append("M");
    break;
    case ORANGE:
    str.append("M");
    break;
    default: //Empty
    str.append(" ");
    }
    str.append("|");
    }
    str.append("\n");
    }
    return str.toString();
    }
    }

    This code should seem familiar to you. The methods in the TicTacToeGame class are similar to those in the Board class. The StringBuilder class was used instead of the String class for better performance. You can learn more about the StringBuilder class by visiting the Oracle Website at http://docs.oracle.com/javase/tutorial/java/data/buffers.html.

    8. Add the following import statement to the BoardGameTester class:
    import games.boards.*;

    9. In the main() method of BoardGameTester, perform the following actions:
    a. Create a 3 × 3 board for a Tic-Tac-Toe game.
    b. Create a 6 × 7 board for a Connect Four game.
    c. Create a 5 × 8 board for a game of Mastermind.
    d. Set a cell to a nought or cross on the Tic-Tac-Toe board.
    e. Set a cell to yellow or red on the Connect Four board.
    f. Set a cell to yellow, red, green, blue, magenta, or orange on the Mastermind board.
    g. Display the boards for Tic-Tac-Toe, Connect Four, and Mastermind.

    10. Compile and run the project to ensure it works as you expected it to.

    Learn More
  2. Penn foster Graded Project Number Guessing Game JavA

    Penn foster Graded Project 1 Number Guessing Game Java

    Regular Price: $20.00

    Special Price: $15.00

    Penn foster Graded Project Number Guessing Game Java

    For your first project, you'll create a simple number guessing game. The game will use a for statement to ask for three guesses and an if statement to determine if the answer is right.

    1. In NetBeans, create a new Java Application project named NumberGuess. Review Activity 2 for details.

    2. In the main() method, add the following code to generate a random number. Note that the fourth and fifth lines of code should all go on one single line.
    int randNum, guessNum, attemptNum;
    //Generates a random number from 1 to 10
    randNum = new java.util.Random().nextInt(10) + 1;
    System.out.println("I am thinking of a number from 1 to 10");

    3. Using a for loop, ask for three guesses, using the attemptNum variable. See pages 23–24 in the textbook for more details. You can use the following code to ask for a guess:
    System.out.print("Guess? ");
    //Wraps the default input in a simple parser
    called Scanner
    java.util.Scanner scan = new
    java.util.Scanner(System.in);
    guessNum = scan.nextInt(); //Reads the next command-line int
    System.out.println("You guessed " + guessNum);

    4. Using an if statement in the for block, determine whether randNum and guessNum are equal. See pages 21–23 for in the textbook for more details. You can use the following code if randNum and guessNum are equal:
    System.out.println("You guessed it!");
    break;

    5. When you're finished, the contents of the main() method should resemble the following:
    int randNum, guessNum, attemptNum
    //Generates a random number from 1 to 10
    randNum = new java.util.Random().nextInt(10) + 1;
    System.out.println("I am thinking of random number from 1 to 10");
    for (/* Figure this part out yourself */) {
    System.out.print("Guess? ");
    java.util.Scanner scan = new
    java.util.Scanner(System.in);
    guessNum = scan.nextInt();
    System.out.println("You guessed " + guessNum);
    if (/* Figure this part out yourself */) {
    System.out.println("You guessed it!");
    break;
    }
    }

    6. Compile and run the project to ensure it works as expected. To type input, make sure you click in the Output panel; otherwise, you’ll modify code.

    Learn More
  3. CIS355A Week 7 Course Project Flooring Application User Manual and Application Code

    CIS355A Week 7 Course Project Flooring Application User Manual and Application Code

    Regular Price: $25.00

    Special Price: $20.00

    CIS355A Week 7 Course Project Flooring Application User Manual and Application Code


    Your application must include at least three tabs. The user will choose wood flooring or carpet, enter the length and width of the floor, as well as the customer name and address. The application will compute the area of the floor and the cost of the flooring considering that wood floor is $20 per square foot and carpet is $10 per square foot. A summary should be displayed, either in a tab or another window, listing the customer name and address, floor selection, area, and cost. This information should also be stored in the MySQL database table. The program should validate that all information is entered and that the length and width are numeric values. Any numeric or currency values must be formatted appropriately when output. Recommendations for the components used for input are
    • radio buttons—flooring type (wood or carpet);
    • text fields—customer name, customer address, floor length, and floor width; and
    • buttons—calculate area, calculate cost, submit order, display order summary, display order list.
    The MySQL database table is called flooring and has the following description.
    Field Type
    CustomerName varchar(30)
    CustomerAddress varchar(50)
    FlooringType varchar(10)
    FloorArea Double
    FloorCost Double
    In addition to entering new customer orders, your application should list all customer orders stored in the database. These will be viewed as a list, in a text area, and will not be updated by the user.


    User Manual (Due Week 7)
    Your actual Course Project and user manual are due at the end of Week 7. However, it is strongly recommended that you start your project in Week 5 to avoid many last minute issues.
    In Week 7, you will be required to submit a user manual, as well as your Java code. The user manual can be a simple Word document with screenshots that explains how to run your application. Your mark will depend both on the program quality and the quality of the user manual.
    Here are some more detailed guidelines about the user manual.
    It does not need to be long, probably not more than 5 pages, including screenshots.
    Write at the expected user's level, not too technical.
    Detail all the functionality that the application provides.
    For each function, show what is its purpose and sample execution, with a screenshot.


    User Manual Points Description
    Sufficient length to describe the application 5 Manual contains explanation in detail of all relevant areas of the application
    Contains screenshots of the key interface components 5 Images of each section of the application
    Operations are explained 5 Detailed operation of each section of the application
    Written to the user's level and is not technical 5 Must not contain code or any other technical items irrelevant to the users
    Subtotal 20


    Application Code (Due Week 7)
    The following grading rubric will be used for the code portion of the project.
    Flooring Application Points Description
    Standard header included 2 Must contain program name, student name, and description of the program
    Program compiles 2 Program does not have any error
    Program executes 2 Program runs without any error
    Includes at least 3 tabs 10 Three or more tabs are used
    Includes components for all required inputs 35 Components for customer name, address, floor type, length, width, area and cost with buttons to calculate area, calculate cost, display order summary, and display order list are included
    Area calculation 4 Area is calculated correctly
    Cost calculation 5 Cost is calculated correctly
    Included data validation 10 If no values or non-numeric values are entered, the proper error message should display.
    Correct data is stored in the database table 10 When values are entered, the data is stored correctly in the database table.
    Customer orders are displayed in a list 10 All records saved to the database are displayed in a list with appropriate formatting.
    Correct output is displayed 10 When values are entered, the order summary is shown with appropriate formatting.
    Total 100

    Learn More
  4. CIS355A Week 2 iLab StudentGPAInfo Java Program

    CIS355A Week 2 iLab StudentGPAInfo and CurrencyConversion Java Program

    Regular Price: $25.00

    Special Price: $20.00

    CIS355A Week 2 iLab StudentGPAInfo and CurrencyConversion Java Program


    In this lab, you will create two programs that use classes and methods.
    Deliverables
    Program files for the following program
    StudentGPAInfo
    CurrencyConversion


    STEP 1: StudentGPAInfo (20 points)
    Create a class called StudentGPAInfo.java that contains one double-precision instance variables named gpa. It should also contain two integer instance variables named totalgradepoints and numberofclasses. Finally, there should be one instance variable named studentname of string type. The class should include a constructor that initializes the name, numberof classes, and totalgradepoints variables, as well as a default constructor. Also, you need an instance method named calculateGPA() that calculates the student's grade point average by using this formula: totalgradepoints divided by numberofclasses. Also, you need an instance method. Create one set method that will assign values to the studentname, totalgradepoints, and numberofclasses variables. Create a displayStudent method that will display all of the attributes of the StudentGPAInfo object. Display the GPA with an accuracy of two decimal places (i.e., 3.25).


    Write a class called GPATest.java. Create one StudentGPAInfo object named student1 using constructor that allows you to pass values to the object. Pass any values you would like to use. Create another StudentGPAInfo object named student2 using the default constructor. Using the set method, assign values to the student2 object. Next, use the calculateGPA() methods on both objects, then invoke the displayStudent() method on each of the objects.


    STEP 2: CurrencyConversion (20 points)
    You must create a program named CurrencyConversion.java that converts money between the following currencies.
    Given one of the three currencies, the program should convert the input amount into one of the other currencies. For example, if you input one (1) U.S. dollar, and you decide to convert that one dollar to a pound, then the output should be .60.
    Using the JOptionPane GUI, do the following.
    Prompt the user for the currency code type.
    Prompt the user for the amount of that currency.
    Prompt the user for the currency code that the entered amount must be converted to.
    Using the table above, the following formula was used to convert USD to JPY.
    10.00 * 103.73 = 1,037.30
    Display the results in a JOptionPane message box.

    Learn More
  5. CIS355A Week 3 iLab InheritanceTest Java Program

    CIS355A Week 3 iLab InheritanceTest and Greeting Java Program

    Regular Price: $25.00

    Special Price: $20.00

    CIS355A Week 3 iLab InheritanceTest and Greeting Java Program


    Scenario/Summary
    In this lab, you will create one project that uses inheritance and one simple Applet.


    Deliverables
    Program files for each of the following programs
    1. InheritanceTest; and
    2. Greeting.


    iLAB STEPS
    Step 1: InheritanceTest
    Implement an inheritance hierarchy based on the following specifications for Account class, Checking Account class, and Savings Account class:
    Account class
    • Methods:
    o processDeposit ( ) - accepts a single double parameter containing the deposit amount. Updates the balance by adding the deposit amount to the balance.
    o processWithdrawal ( ) - accepts a single double parameter containing the withdrawal amount. Updates the balance by subtracting the withdrawal amount for the balance. Note: For now do not worry about negative balances.
    o calcInterest ( ) - Coded as a double method with an empty body.
    • Attributes:
    o String Account Name
    o Integer Account ID
    o Double balance
    • Constructor
    o Prompt the user and accept input for the Account Name, Account ID and the initial balance.
    The CheckingAcct class which is a derived class of the Account class.
    • Attributes:
    o Inherits all the attributes of the Account class.
    o The overDraftFee is double and is populated in the constructor of the CheckingAcct class.
    • Methods:
    o calcInterest () - If the account balance is greater than or equal to 3000.00 an interest rate of 1% or .01 is applied to increase the balance.
    • Constructor:
    o Prompt the user for the OverDraftFee.
    The SavingsAcct class which is a derived class of the Account class.
    • Attributes:
    o Inherits all the attributes of the Account class.
    o There are no other attributes.
    • Methods:
    o calcInterest ( ) - If the account balance is greater than or equal to 5000.00 an interest rate of 4% or .04 is applied to increase the balance. If the balance is greater than or equal to 3000.00 an interest rate of 3% or .03 is applied to increase the balance. Otherwise use an interest rate of 2%. The new balance is returned to the calling program.
    • Constructor:
    o Inherited from the Account class. (no code needed)
    Main:
    Prompt the user for the bank name and routing number. Create at least two account objects (each of a different type). Process a deposit then withdraw then calculate the interest for each account. Generate the following report:
    Bank Name: XXXXXXXX Routing Number: XXXXXX
    Account Name: XXXXXX Account ID: XXXXXXXXX Balance: 9999.99
    Account Name: XXXXXX Account ID: XXXXXXXXX Balance: 9999.99


    Step 2: Greeting
    Create an applet of size 500 by 500. The background color of the applet should be yellow. The four components to be included are
    1. a Label object that has the text "Please enter your name;"
    2. a Textfield object of size 20;
    3. a Button object with the text "GREET;" and
    4. a Label object with the text "Result goes here." This label will change to "Hello," followed by the entered name.
    For this lab, you will need the actionPerformed method to provide event handling for the button.
    The getText() method will be needed to get the string from the TextField.
    The setText() method will be needed to change the text of the second Label.
    Test your applet by entering your full name and confirming that the result label has changed.

    Learn More
  6. Grade Calculator Java Assignment

    Grade Calculator Java Assignment

    Regular Price: $15.00

    Special Price: $12.00

    Grade Calculator Java Assignment

    In this lab Use two classes to do this assignment. Name the first class TestGrade, it will be a driver class that is to create an instance of the second class, prompt and get values, and display values. The second class will be named Grade, this is where all the core logic in contained.

    Learn More
  7. CIS355A Week 4 iLab Quick Fast Car Care Application

    CIS355A Week 4 iLab Quick Fast Car Care Application

    Regular Price: $25.00

    Special Price: $20.00

    CIS355A Week 4 iLab Quick Fast Car Care Application


    iLAB STEPS
    Step 1: Quick Fast Car Care Application
    Quick Fast Car Care is a small business that specializes in oil changes and car washes. Their strategic advantage is providing quick service. To provide quick service, this owner wants a new application that will calculate services provided to customers. The table below has the services and the cost of these services.


    Oil Change Cost
    Bronze $20
    Silver $25
    Gold $30

    Car Wash Cost
    Basic $5
    Better $10
    Best $15


    Your manager wants you to create a prototype Java application using menus that will calculate the cost of a customer getting an oil change, car wash, or both. This application should add the appropriate amount to the total cost when services are provided. When the total menu item is selected, a message box should display the services purchased and the total amount. Allow the client to use the clear menu item to wipe out the memory and start fresh for a new customer. The exit menu item should close the application. Use the screen designs below to model your application.

    Learn More
  8. CSC 275 Assignment 3 Flower Pack

    CSC 275 Assignment 3 Flower Pack

    Regular Price: $20.00

    Special Price: $15.00

    CSC 275 Assignment 3 Flower Pack


    After dinner with Alexander and Elizabeth we notice that Alexander is mixing some herbs as a medication for Elizabeth which eases her pain and helps her sleep. Once the medicine is administered we begin small talk with Alexander. During the conversation he tells us the story about how his mother and father were hopelessly in love and were lucky enough to die side by side protecting the things they loved most, their children.
    In the middle of the story we become distracted by Elizabeth trying to request something, but we can't make out what she wants because her medicine has kicked in. After a few moments we determine she is requesting a flower, but we can't understand the entire name, just the start. Instantly we remember that we know how to search through our flower pack while only using partial names. We instantly turn around and start working on yet another improvement to the flower pack.
    • Create a flower object that has specific traits (name, color, presence of thorns and smell)
    • These flower objects must be able to stay in his pack (Use an ArrayList)
    • Be able to add and remove flowers
    • Implement a partial search (Searching for 'r' should return all flowers with an 'r' in their name, and the same goes for any partial search). This is commonly known as a filter.


    As a new addition a rubric has been added to blackboard for the assignment.
    Using the same code as assignment 2 you can make your changes. I have included some base code for your convenience (This is 2 classes, Assignment3 and Flower).

    Learn More
  9. CIS355A Week 5 iLab 5 Step 1 Write Clients to File

    CIS355A Week 5 iLab GUI Graphics and File I/O

    Regular Price: $25.00

    Special Price: $20.00

    CIS355A Week 5 iLab GUI Graphics and File I/O


    Scenario/Summary
    In this lab, you will create one project that reads from a file, one project that writes to a file, and one project drawing a snowman.


    iLAB STEPS
    STEP 1: Writing out Client Information
    1) Create the following GUI, so that when your program is running, your user can input information regarding a client and hit the save button to save the information out to a file.
    2) Every time the user hits the save button, that information should be saved out to a file called client.txt; each new client's information should append to the information already saved onto the file client.txt.
    3) The data in the client.txt file should be formatted like the following.
    Client Activity Report
    Client Name Client ID Starting Balance Closing Balance
    XXXXXXXXX 9999999 99999.99 99999.99
    XXXXXXXXX 9999999 99999.99 99999.99
    XXXXXXXXX 9999999 99999.99 99999.99

    STEP 2: Reading in Client Information
    1) Create a class called Client, the Client class must contain attributes for Client name, Client ID, starting balance, and closing balance, and all other accessor/mutator/constructor functions as necessary.
    2) Assume you have a client.txt file with the following sample information.
    Charles Smith|100235|5700.75|1200.00
    James Peterson|320056|349.56|4005.56
    Francis Lewis|400556|7500.00|456.23
    William Burgess|45399|5000.00|1245.56
    Philip Wilson|10090|10000.00|2300.75
    James Brown|34291|25000.45|31454.86
    3) Create a Client ArrayList to process input records in main().
    4) Use a for loop to read in the information from client.txt.
    5) The GUI to this program should look similar to this:
    6) Once the user hits the display button, everything read in from the file should display in the Console window in this format.
    Client Activity Report
    Client Name Client ID Starting Balance Closing Balance
    XXXXXXXXX 9999999 99999.99 99999.99
    XXXXXXXXX 9999999 99999.99 99999.99
    XXXXXXXXX 9999999 99999.99 99999.99


    STEP 3: Snowman!
    Use the many draw methods provided to you by Java and draw a Snowman—be as creative or as basic as you would like, as long as the final result resembles a snowman. It doesn't have to necessarily look exactly like this, but this is the minimum you should achieve with your drawing.
    1) You must have at least three circles in your project.
    2) You must have at least a line, a polygon, an oval, or a rectangle.
    3) In addition to your snowman, you should also use drawString to draw some text.
    4) Use draw or fill and the color class as you see fit.
    Hint: frame.getContentPane().setBackground(Color.blue); //This is the code you need to set the frame's background color. Have Fun!

    Learn More
  10. CIS355A Week 4 Course Project Flooring Application Analysis and Design

    CIS355A Week 4 Course Project Flooring Application Analysis and Design

    Regular Price: $20.00

    Special Price: $15.00

    CIS355A Week 4 Course Project Flooring Application Analysis and Design


    Developing a graphical user interface in programming is paramount to being successful in the business industry. This project incorporates GUI techniques with other tools that you have learned about in this class.
    Here is your assignment: You work for a flooring company. They have asked you to be a part of their team because they need a computer programmer, analyst, and designer to aid them in tracking customer orders. Your skills will be needed in creating a GUI program that calculates the flooring cost and stores the order in the database.
    The project has three components: an analysis and design document, the project code, and a user manual. The analysis and design document is due Week 4. The code and user manual are due in Week 7. It is suggested that you begin working on the code in Week 5, which should give you ample time to complete the project. You will find that the lectures and lab assignments will prepare you for the Course Project.


    Guidelines
    Your application must include at least three tabs. The user will choose wood flooring or carpet, enter the length and width of the floor, as well as the customer name and address. The application will compute the area of the floor and the cost of the flooring considering that wood floor is $20 per square foot and carpet is $10 per square foot. A summary should be displayed, either in a tab or another window, listing the customer name and address, floor selection, area, and cost. This information should also be stored in the MySQL database table. The program should validate that all information is entered and that the length and width are numeric values. Any numeric or currency values must be formatted appropriately when output. Recommendations for the components used for input are
    • radio buttons—flooring type (wood or carpet);
    • text fields—customer name, customer address, floor length, and floor width; and
    • buttons—calculate area, calculate cost, submit order, display order summary, display order list.
    The MySQL database table is called flooring and has the following description.
    Field Type
    CustomerName varchar(30)
    CustomerAddress varchar(50)
    FlooringType varchar(10)
    FloorArea Double
    FloorCost Double
    In addition to entering new customer orders, your application should list all customer orders stored in the database. These will be viewed as a list, in a text area, and will not be updated by the user.


    Analysis and Design (Due Week 4)
    In Week 4, you will complete the analysis and design for the project. You will use the guidelines described above and the grading rubric below to complete this document. You will create the following items.
    1. Request for new application
    2. Problem analysis
    3. List and description of the requirements
    4. Interface storyboard or drawing
    5. Design flowchart or pseudocode
    The analysis and design document will be a single MS Word document, which contains all descriptions and drawings. See the grading rubric below for the analysis and design document, due in Week 4.
    Item Points Description
    Request for New Application 2.5 A table containing: date of the request, name of the requester (your professor), the purpose of the request, the title of the application (create your own title), and brief description of the algorithms used in the application
    Problem Analysis 2.5 Analyze the problem to be solved, and write in a few words what is the problem and what is being proposed to solve the problem
    List and Description of Requirements 5 A description of the items that will be implemented in order to construct the proposed solution
    Interface Storyboard or Drawing 5 A picture or drawing of what the application will look like; must include the image of each section of the application in detail
    Design Flowchart or Pseudocode 5 A sketch of the flow of the application or the pseudocode of the application

    Learn More

Items 41 to 50 of 100 total

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

Grid  List 

Set Ascending Direction