Welcome to AssignmentCache!

Search results for 'dbm 502 Mountain View Community Hospital'

Items 1 to 10 of 13 total

per page
Page:
  1. 1
  2. 2

Grid  List 

Set Descending Direction
  1. CIS355A iLab 6 Step 1 index Java Program

    CIS355A iLab 6 Index Index2 and ThreeArrayLists Java Programs

    $15.00

    CIS355A iLab 6 Index Index2 and ThreeArrayLists Java Programs

    In this lab you will create three programs
    Index.java
    Index2.java
    ThreeArrayLists.java

    Program files for each of the following three programs
    Index
    Index2
    ThreeArrayLists

    iLAB STEPS
    STEP 1: Index (10 points)
    Write a Java GUI application called Index.java that inputs several lines of text and a search character and uses String method indexOf to determine the number of occurrences of the character in the text. This program is not case sensitive and both upper and lower case must be counted for.
    Sample Program output: View Output Description

    STEP 2: Index2 (10 points)
    Write a Java GUI application Index2.java based on the program in Step 1 that inputs several lines of text and uses String method indexOf to determine the total number of occurrences of each letter of the alphabet in the text. Uppercase and lowercase letters should be counted together. Store the totals for each letter in an array, and print the values in tabular format after the totals have been determined.
    Sample Program output: View Output Description

    STEP 3: ThreeArrayLists (20 points)
    Write a program called ThreeArrayLists.java that declares three ArrayList objects referenced by the objects named priceList, quantityList, and amountList. Each ArrayList should be declared in main() and should be capable of holding a minimum of 10 double-precision numbers.
    • The numbers that should be stored in priceList are 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, 3.98.
    • The numbers that should be stored in quantityList are 4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9 4.8.
    Your program should pass object references to these three ArrayList objects to a method named extend(), which should calculate the elements in the amountList ArrayList as the product of the corresponding elements in the priceList and quantityList ArrayList, for example, amountList.add(priceList.get(i) * quantityList.get(i)).
    After extend() has put values into the amountList ArrayList object, create a method that displays the results of all three lists. Appropriate formatting techniques need to be used to produce a formatted output.
    Tip: It is a good idea to create two arrays of type double to store the values that correspond to the price and the values that correspond to the quantity, for example:
    double[] PRICE_ARRAY = { 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, 3.98 };
    double[] QUANTITY_ARRAY = { 4.0, 8.5, 6.0, 7.35, 9.0, 15.3, 3.0, 5.4, 2.9, 4.8 };
    Sample program output:
    1) 10.62 * 4.0 = 42.48
    2) 14.89 * 8.5 = 126.56
    3) 13.21 * 6.0 = 79.26
    4) 16.55 * 7.35 = 121.64
    5) 18.62 * 9.0 = 167.58
    6) 9.47 * 15.3 = 144.89
    7) 6.58 * 3.0 = 19.74
    8) 18.32 * 5.4 = 98.93
    9) 12.15 * 2.9 = 35.24
    10) 3.98 * 4.8 = 19.1

    Learn More
  2. Penn Foster Exam 40259500 Tic-Tac-Toe game Java Program

    Penn Foster Exam 40259500 Tic-Tac-Toe game Java Program

    $12.00

    Penn Foster Exam 40259500 Tic-Tac-Toe game Java Program

    In this project, you’ll create a text-based Tic-Tac-Toe game in which each player places either an X or O mark on a ninegrid square. An X mark is known as a cross, while an O is called a nought. The winner is the first player to place their mark on three contiguous squares vertically, horizontally or diagonally across. You can read about it in more detail on Wikipedia (http://en.wikipedia.org/wiki/Tic-tac-toe).
    The output of this project will be referenced in the subsequent graded projects for this course

    1. In NetBeans, create a new Java Application project named TicTacToeGame.

    2. Add the following variable and constant declarations to the TicTacToeGame class:
    static int[][] gameboard;
    static final int EMPTY = 0;
    static final int NOUGHT = -1;
    static final int CROSS = 1;
    Note: The variable gameboard is a two-dimensional int array.
    Think of it as a table with rows and columns, where a cell can be empty (0) or contain a nought (–1) or cross (1) . The constants EMPTY, NOUGHT, and CROSS will simplify your code.

    3. Add the following utility methods to the TicTacToeGame class:
    static void set(int val, int row, int col) throws IllegalArgumentException {
    if (gameboard[row][col] == EMPTY) gameboard[row][col] = val;
    else throw new IllegalArgumentException(“Player already there!”);
    }
    static void displayBoard() {
    for( int r = 0; r < gameboard.length; r++ ) {
    System.out.print(“|”);
    for (int c = 0; c < gameboard[r].length; c++) {
    switch(gameboard[r][c]) {
    case NOUGHT:
    System.out.print(“O”);
    break;
    case CROSS:
    System.out.print(“X”);
    break;
    default: //Empty
    System.out.print(“ “);
    }
    System.out.print(“|”);
    }
    System.out.println(“\n———-\n”);
    }
    }

    4. Add the following method signatures to the TicTacToeGame class:

    5. Define the createBoard method.

    6. Define the winOrTie method. Check first for a win with rows and columns and then diagonally. Finally, check to see if there are any empty cells without a cross or naught.
    static void createBoard(int rows, int cols) {
    //Initialize the gameboard
    }
    static boolean winOrTie() {
    //Determine whether X or 0 won or there is a tie
    }
    Note: Review the sections “Initializing Multidimensional Arrays” on pages 144–145 and “Iterating Over Multidimensional Arrays” on pages 156–158 for how to initialize and iterate through a multidimensional array. A player wins if all the cells in a row or column are the same mark or diagonally through the center. The players tie if all cells have a cross or nought, but no player has three marks horizontally, vertically, or diagonally. Return NOUGHT if nought wins, CROSS
    if cross wins, 0 if there’s a tie, and another value (like –2, for example) if there are empty cells on the board.

    7. In the main() method, perform the following actions:
    a. Create the board and initialize a turn counter, player value, and game outcome. For nought, the value is –1, while 1 is the value for cross.
    b. While there’s no winner or tie, display the board and prompt for a row and column for the current player.
    static void createBoard(int rows, int cols) {
    //Initialize the gameboard
    }
    static boolean winOrTie() {
    //Determine whether X or 0 won
    c. Use a try/catch block to handle the exception from the set method. You can use the System.err.println method rather than the System.out.println method
    to output the exception. This will display the message in red.
    d. Display the final board and a message on which player won or if there’s a tie.

    8. When completed, the contents of the main() method should resemble the following:
    createBoard(3,3);
    int turn = 0;
    int playerVal;
    int outcome;
    java.util.Scanner scan = new java.util.Scanner(System.in);
    do {
    displayBoard();
    playerVal = (turn % 2 == 0)? NOUGHT : CROSS;
    if (playerVal == NOUGHT) System.out.println(“\n—O’s turn—”);
    else System.out.println(“\n—X’s turn—”);
    System.out.print(“Enter row and column:”);
    try {
    set(playerVal, scan.nextInt(), scan.nextInt());
    } catch (Exception ex) {System.err.println(ex);}
    turn ++;
    outcome = winOrTie();
    } while ( outcome == -2 );
    displayBoard();
    switch (outcome) {
    case NOUGHT:
    System.out.println(“O wins!”);
    break;
    case CROSS:
    System.out.println(“X wins!”);
    break;
    case 0:
    System.out.println(“Tie.”);
    break;
    }

    9. Compile and run the project to ensure it works as expected. Try a few games to verify all wins and ties are correctly detected.
    The application should behave as follows in the Output window:
    | | | |
    | | | |
    | | | |

    —O’s turn—
    Enter row and column:0 0
    |O| | |
    | | | |
    | | | |

    —X’s turn—
    Enter row and column:0 1
    |O|X| |
    | | | |
    | | | |

    —O’s turn—
    Enter row and column:1 1
    |O|X| |
    | |O| |
    | | | |

    —X’s turn—
    Enter row and column:2 0
    |O|X| |
    | |O| |
    |X| | |

    —O’s turn—
    Enter row and column: 2 2.
    |O|X| |
    | |O| |
    |X| |O|
    O wins!

    SUBMISSION GUIDELINES
    To submit your project, you must provide the following two files:
    TicTacToeGame.java
    TicTacToeGame.class
    To find these files within NetBeans, go to the TicTacToeGame project folder. To determine this folder, right-click on TicTacToeGame project in the Projects panel. Copy the value for the Project Folder textbox using the keyboard shortcut CTRL+C. In Windows Explorer, paste the project folder path and hit the ENTER key. Copy both the TicTacToeGame.java file from the src\tictactoegame folder and the TicTacToeGame.class file from the build\tictactoegame folder to your desktop or any other temporary location.

    Learn More
  3. Employee Online Time Clock Project

    Employee Online Time Clock Project

    $25.00

    Employee Online Time Clock Project

    Overview
    The final project for this course is the creation of an Online Time Clock. The final project is designed to allow you to put together the concepts learned in the course and to demonstrate your ability to write a useful Java program. The final project is given early in the course so that you will have plenty of time to design the program before it is due.
    Early in the course, you will not have the knowledge to implement many of the required elements, but you will still be able to move your project forward by designing it at the conceptual level. Diagramming and pseudo coding before coding a project allows you to think through what needs to be done in detail, thus allowing you to see design flaws before they have been coded. The extra effort to design the program before coding will make the coding process much easier and will result in fewer bugs. The project specifications include a list of requirements that demonstrate different areas of Java development that must be included in your final project to demonstrate your skill in that area. The project shall demonstrate the following skills:
    • Use of a static member
    • Use of extended class
    • Code Commenting
    • GUI or Console based interface
    • Use of public and private methods
    • Use at least one overloaded constructor
    • Create instances of class(es)
    • Use the 'this' reference
    • Optional: Exception handling using try/throw/catch/finally

    The project is divided in to Six Milestones, which will be submitted at various points throughout the course to scaffold learning and ensure quality final submissions. These milestones will be submitted in Modules Four, Six, Seven, Eight, Nine, and Ten.

    Main Elements

    Approach Blueprint
    Coding a project of this size requires some planning and time. Work on building a blueprint for the program throughout the term. Having a blueprint will make the coding simpler and keep you from going down dead ends. Some important things to work on early:
    • If the application is using more than one screen (console applications have no choice.), what is the flow between screens? A flow chart that covers all of the possible screen access possibilities will avoid logic problems in the application.
    • Break the program down into a set of classes that will work together to execute the program. Object oriented programs are easier to write than structured programs because each class has one set of functionality that it does well and working on one piece at a time makes the programming easier. List out the properties and methods that each class will use so that the relationship between the classes can be established. (Software Engineers create formal class diagrams that show the class hierarchy of a program and how they interrelate. A formal class diagram is not required for this project, but sketching a rough diagram will make things easier.)
    • Optional: Error handling can have unexpected results if not done correctly. Diagram how your exception handling will work by sketching a flow chart.
    • Validation can be as tricky as error handling, so sketching a diagram is also useful.
    • Devise a strategy for handling data. The data may be held in objects in memory, or, optionally, in text files. If you decide to use memory objects, then there should be separate objects for Employee information and their time clock records. The employee memory object (or employee.txt flat file) will be relatively simple since there are no deletes or modifications to an input value. Employees will be employee ID order. The time clock memory object (or timeclock.txt file) is a different story because the records will not be in employee ID order; they will be in the order that an employee punched in or out. When generating a report it will be necessary to find all of the data for each employee and output it in chronological order. The chronological order is already in the memory object (or file) because we are not deleting or modifying any data. The program will only need to group all of the data for an employee together. This can be done in several ways (You may choose which is best, or come up with another solution):
    o When an employee punches in or out the program can search the data file and insert the value after the last entry for that employee.
    o The system can sort the values in the file in memory as part of the reporting functionality, leaving the data in the file in its original order.

    Caution is in order because the records should have the punch in time and punch out time for a single day in order. (They will be in that order in the file, because someone has to punch in before they punch out. The program specifications require checking for a 'punched in' record before saving a 'punched out' record.)
    NOTE: The separate screen descriptions are for console applications. The GUI application may use one or more screens, as appropriate, but the functionality shall remain the same).
    NOTE: Functionality labeled as Optional does not have to be implemented. It is for students who would like to write a more challenging program.
    NOTE: Those developing a GUI application will replace the 'input values' with appropriate GUI objects such as buttons. For example, instead of inputting 'A' for Add New Employee, create a button for adding a new employee.

    Scenario
    A company hires you to write a program to track hourly employee arrival and departure times from work. In essence, you are tasked to make an online time clock. The time clock shall keep a history of an employee’s hours for a two-week pay period. The application shall have the following functionality:

    Main Screen
    The main screen shall act as a menu to access program functionality and to exit the program.
    The main screen shall:
    • Display 4 options
    A) Add New Employee – Displays new employee screen
    B) Punch In/Out – Displays punch in/out screen
    C) Report – Displays report screen
    D) Exit – Exits the program
    • Display an input field called "Choice" to input one of the four options.
    • Inputting an incorrect option shall display a prompt indicating that the input was invalid and to try again.
    • Optional functionality: If the user enters an incorrect value more than 3 times, display a prompt that the program is exiting and close the program.

    Add New Employee Screen
    The 'add new employee screen' shall:
    • Add a new employee (we will not worry about modifying or deleting.), saving the data to a memory object or file.
    o The program shall allow the user to enter the Employee’s First and Last Name
    o The program shall validate the first and last name entered to ensure they are not blank. (We will assume that everyone has a first and last name.)
    o The program shall assign a new employee ID to the employee and display it on the screen.
    o The employee ID shall be generated by adding 1 to the largest employee ID already in the employee memory object (or employee.txt data file).
    o The program shall allow the user to enter an unlimited number of employees. In console based applications, the system shall prompt “Do you want to enter another? (y/n). Entering 'y' shall clear the screen and prompt for another employee. If 'n', the program shall return to the main screen.
    o The employee data shall be saved to a memory object called employee (or file called employee.txt)
    o Optional functionality: Check the first and last name to ensure that there are only valid characters. For examples, filter out numbers, punctuation, etc. Commas can cause problems because the data is being saved to comma-delimited files and that can be a headache!

    Punch in/out Screen
    The 'punch in/out screen' shall:
    • Save the punch in or punch out date and time of the employee to a memory object (or file).
    o The date and time, 'I' for Punched In or 'O' for punched out along with the Employee ID shall be saved to a memory object called timeclock (or file called timeclock.txt).
    o The recorded date for 'punched in' and 'punched out' shall be the method for matching corresponding records.
    o The program shall test to ensure that there is a 'Punched in' record for the corresponding day before a 'punched out' record is saved. If none is found, prompt the user to enter a 'punched in' time.
    o Then the user has punched in or out, the program shall display a message indicating that the employee has punched in or out, the employee ID, date and time.
    o In console based applications the screen shall display "Press any key to continue"
    o In console based applications the program shall return to the main menu after a key is pressed when the “Press any key to continue” prompt is displayed.
    o Optional functionality: Add the day of the week to the data saved.

    Report Screen (Hint: If you are writing a console application, java.io.PrintWriter may be useful.)
    The 'report screen' shall:
    • Allow the user to display a work history report for an individual or for all employees for the two weeks prior to the report request.
    o The screen shall display a prompt to enter 'I' for individual employee report, 'A' for all employees report.
    o If the selected value is 'I', prompt the user to enter the employee's ID number.
     If 'I' is selected the display shall show the employee's name and ID, list out each day worked in chronological order, the number of hours worked that day and a total number of hours worked in the two week period.
     The report shall prompt the user to re-enter an employee ID of it does not exist in the employee file.
     Optional Functionality: If the user inputs a nonexistent employee ID more than 3 times, prompt the user and then return to the main screen.
    o If the selected value is 'A', output the information to the console for the past two weeks.
    o The end of the report shall display "Press any key to continue" to return to the main menu.
    o Optional Functionality: Allow the user to print the report to a printer.

    Example Screen Shots
    The following screen shots are suggestions for setting up your application. You are not required to make your screens look like these, they are only provided to help you think about the program’s interface. Items that are inside a red box are some example prompts that may not be displayed unless a particular action takes place. You may have more or different prompts depending on how you decide to create your program.
    Console Based Application

    GUI Base Application Using One Screen (You are free to use multiple screens, if desired.)

    Learn More
  4. Travel Agents System Java Program

    Travel Agents System Java Program

    $30.00

    Travel Agents System Java Program

    You are to develop program in Java for a small travel agents. The company arranges holidays from four UK airports to five international destinations. Users need to find flight times and costs for journeys between these destinations. The system also provides information on hotels at the destinations (name of hotel and cost per person per night). Information on hotels can only be added, or loaded from file, when the program is running. The following table (Table 1) provides the airport names, destinations, costs and flight times for the journeys Table 1 Information for the travel agents program – the two values represent cost (£) and flight time (hours) respectively – you can make up your own (realistic values) if you wish

    Airport/Destination | New York |Dahab | Rome |Sydney |Tokyo
    East Midlands |200/5.0 |150/4.0 |100/1.0 |500/22.0 |400/12.0
    Birmingham |190/4.8 |140/3.5 |95/1.1 |480/22.5 |380/12.5
    Heathrow |195/4.9 |140/3.6 |95/1.1 |490/23.0 |390/12.5
    Manchester |210/5.5 |145/3.7 |110/1.2 |470/22.7 |370/12.6

    (the above is a data table, where there is a line, represents the cell)

    Your program should have a main menu with four options – Time, Price, Hotels and End (which terminates the program). The Hotels option takes the user to another (Hotel) menu with the following six options – View Hotels; Add Hotel; Delete Hotel; Save Hotels; Retrieve Hotels; Exit (back to the previous menu). Note that your program should include appropriate error trapping – for example, entering an invalid date (eg 30 February).
    Functionality for each of these menu options is explained below:
    Time – Provides the flight time presented in hours.
    Price – The cost of travelling from an airport to a given destination (both selected by the user). Note, if the customer is travelling on the last day of the month the fare should be increased by 5% (and display a message to say that this has been done). The system will therefore need to ask the user the date of travel. It should not simply ask the user if it is the end of the month – but work this out from a date provided by the user.
    Hotels – Takes the user to a Hotels Information Menu.
    Hotels menu
    View Hotels – The user selects a destination and the system displays all available hotels at that destination including the overnight cost per person. If there are no hotels for a destination it should display a message to say so.
    Add Hotel – Allows the user to add a hotel for a given destination. This should add to the list of existing hotels for that destination (if there are any). For example, I might add 'Belle Vue' as a hotel in Sydney at a cost of £50 per person per night.
    Delete Hotel – Allows the user to delete a hotel from a list of hotels at a destination.
    Save Hotels – save all the information on all hotels to a single file in a format of your choosing.
    Retrieve Hotels – read in all the information on hotels from a user selected file (a file saved using the previous option). This should overwrite any existing hotel data in the program when it is running.

    Marking
    The more functionality you add to the program the higher your mark. Begin by getting the menu options in place then add functionality to your program in the following order (make sure that earlier parts of the system are working properly before moving on). Your program should also be structured in an object oriented way. You should try to identify and implement a number of classes for this program.

    Minimum pass (40%)
    The flight time between any airport and destination;
    The cost of travel between any airport and destination;
    Increased cost of travel on the last day of the month and a message to say this has been applied;

    40%-70%
    View hotels – users can view information on all hotels at a chosen destination; Add hotel – the ability for users to add hotels for a destination;
    Sort hotels – users can sort all hotels alphabetically;

    Documentation
    Your coursework should be submitted with appropriate documentation. You should include class diagrams, designs, functionality not completed, functionality working, test plans, evaluation, and program listings. Make sure you include an explanation of how your code should be run (eg. which file should be compiled and run and anything I need to know about using the program – a user guide).

    Learn More
  5. 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
  6. CIS355A Week 6 iLab 6 Java Pizza Swing

    CIS355A Week 6 iLab Swing and Database Connection

    Regular Price: $25.00

    Special Price $20.00

    CIS355A Week 6 iLab Swing and Database Connection

    iLAB OVERVIEW
    Scenario/Summary
    Develop one application using JTabbedPanes and JFrames and another application that connects to a MySQL database.
    Deliverables
    1. JavaPizza
    2. ContactList

    iLAB STEPS
    Step 1: JavaPizza
    Develop an application using a JTabbedPane to order a pizza. You will need to ask the customer for their name and phone number. You will ask for the size (choose one) and toppings (choose many) and compute the total. After computing the total, provide a button to display the order summary, which includes the name, phone number, size, toppings, and total. The prices are listed below. Screenshots of a possible solution are included. Your application must include four tabs and open a new window when the button is clicked.
    • Small:  8.00
    • Medium: 10.00
    • Large: 12.00
    Each topping is 2.00 extra.
     
    JavaPizza    Points    Description
    Standard header included    1    Must contain program's name, student name, and description of the program
    Program compiles    1    Program does not have any error
    Program executes    1    Program runs without any error
    Created the JTabbedPane with four tabs    4    The JTabbedPane is displayed with the four required tabs and components on each tab
    Total is calculated correctly    5    The total on the last tab is calculated correctly based on information supplied.
    Order summary window displayed correctly    8    The order summary window is displayed with a JTextArea, including all information from the four tabs.
    Subtotal    20      
     
    Step 2: Contact List
    Develop a Java application to add a contact into the contact table, and display all contacts in the contact table. The contact table contains two columns, FullName, and PhoneNumber. Both values are text data. Use JOptionPanes to ask for the contact data, and display a confirmation message when the contact is added. Display the list of contacts in the console. Screenshots of a possible solution are included.
     
    ContactList    Points    Description
    Standard header included    1    Must contain program's name, student name, and description of the program
    Program compiles    1    Program does not have any error
    Program executes    1    Program runs without any error
    Created the JOptionPanes for input    6    Two JOptionPanes are displayed to retrieve input
    JOptionPane displayed upon insert    4    A JOptionPane is display to confirm the contact was added
    ContactList shown in console    7    The list of contacts is displayed in the console under a heading contact list .
    Subtotal    20

    Learn More
  7. 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
  8. 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
  9. PRG421 Week 1 Individual Coding Assignment Object-Oriented Programming Concepts

    PRG421 Week 1 Individual Coding Assignment Object-Oriented Programming Concepts

    Regular Price: $10.00

    Special Price $7.00

    PRG421 Week 1 Individual Coding Assignment Object-Oriented Programming Concepts

    For this assignment, you will modify existing code to create a single Java™ program named BicycleDemo.java that incorporates the following:

    An abstract Bicycle class that contains private data relevant to all types of bicycles (cadence, speed, and gear) in addition to one new static variable: bicycleCount. The private data must be made visible via public getter and setter methods; the static variable must be set/manipulated in the Bicycle constructor and made visible via a public getter method.
    Two concrete classes named MountainBike and RoadBike, both of which derive from the abstract Bicycle class and both of which add their own class-specific data and getter/setter methods.

    Read through the "Lesson: Object-Oriented Programming Concepts" on The Java™ Tutorials website.
    Download the linked Bicycle class, or cut-and-paste it at the top of a new Java™ project named BicycleDemo.
    Download the linked BicycleDemo class, or cut-and-paste it beneath the Bicycle class in the BicycleDemo.java file.
    Optionally, review this week's Individual "Week One Analyze Assignment," to refresh your understanding of how to code derived classes.

    Adapt the Bicycle class by cutting and pasting the class into the NetBeans editor and completing the following:
    Change the Bicycle class to be an abstract class.
    Add a private variable of type integer named bicycleCount, and initialize this variable to 0.
    Change the Bicycle constructor to add 1 to the bicycleCount each time a new object of type Bicycle is created.
    Add a public getter method to return the current value of bicycleCount.
    Derive two classes from Bicycle: MountainBike and RoadBike. To the MountainBike class, add the private variables tireTread (String) and mountainRating (int). To the RoadBike class, add the private variable maximumMPH (int).
    Using the NetBeans editor, adapt the BicycleDemo class as follows:
    Create two instances each of MountainBike and RoadBike.
    Display the value of bicycleCount on the console.
    Comment each line of code you add to explain what you added and why. Be sure to include a header comment that includes the name of the program, your name, PRG/421, and the date.
    Rename your JAVA file to have a .txt file extension.
    Submit your TXT file to the Assignment Files tab.

    package bicycledemo;

    class Bicycle {
    int cadence = 0;
    int speed = 0;
    int gear = 1;

    void changeCadence(int newValue) {
    cadence = newValue;
    }

    void changeGear(int newValue) {
    gear = newValue;
    }

    void speedUp(int increment) {
    speed = speed + increment;  
    }

    void applyBrakes(int decrement) {
    speed = speed - decrement;
    }

    void printStates() {
    System.out.println("cadence:" +
    cadence + " speed:" +
    speed + " gear:" + gear);
    }
    }
    class BicycleDemo {
    public static void main(String[] args) {

    // Create two different
    // Bicycle objects
    Bicycle bike1 = new Bicycle();
    Bicycle bike2 = new Bicycle();

    // Invoke methods on
    // those objects
    bike1.changeCadence(50);
    bike1.speedUp(10);
    bike1.changeGear(2);
    bike1.printStates();

    bike2.changeCadence(50);
    bike2.speedUp(10);
    bike2.changeGear(2);
    bike2.changeCadence(40);
    bike2.speedUp(10);
    bike2.changeGear(3);
    bike2.printStates();
    }
    }

    Learn More
  10. PRG 421 Week 4 Individual Analyze Assignment Analyzing a Multithreaded Program

    PRG 421 Week 4 Individual Analyze Assignment Analyzing a Multithreaded Program

    Regular Price: $7.00

    Special Price $5.00

    PRG 421 Week 4 Individual Analyze Assignment Analyzing a Multithreaded Program

    Deadlock occurs when no processing can occur because two processes that are waiting for each other to finish. For example, imagine that two processes need access to a file or database table row in order to complete, but both processes are attempting to access that resource at the same time. Neither process can complete without the other releasing access to the required resource, so the result is deadlock.
    Read and analyze code in the linked document that spawns two different threads at the same time.
    In a Microsoft® Word file, predict the results of executing the program, and identify whether a deadlock or starvation event will occur and, if so, at what point in the code.
    Submit your Word file to the Assignment Files tab.
    1. Predict the results of executing the program.
    2. Identify whether a deadlock or starvation event will occur and, if so, at what point in the code.

    /**********************************************************************
    * Program: Week 4 Analyze a Multithreaded Program
    * Purpose: Review the code and predict the results for the program execution.
    * Programmer: Iam A. student
    * Instructor: xxx
    ***********************************************************************/
    Package example deadlk;

    public class Deadlock {
    public static Object Lock1 = new Object(); // aacquires lock on the Lock1 object
    public static Object Lock2 = new Object(); // aacquires lock on the Lock2 object
    public static void main(String args[]) {
    ThreadDemo1 T1 = new ThreadDemo1(); // define the new threads
    ThreadDemo2 T2 = new ThreadDemo2(); // and set name for the threads
    T1.start();
    T2.start();
    }

    private static class ThreadDemo1 extends Thread {
    public void run() {
    synchronized (Lock1) {
    // synchronized Lock1 and Lock 2 will hold the thread until release
    System.out.println("Thread 1: Holding lock 1...");
    try { Thread.sleep(10); } // pause for 10 secs, then access thread
    catch (InterruptedException e) {} // if exception happens, “catch it”
    System.out.println("Thread 1: Waiting for lock 2..."); // display wait condition
    synchronized (Lock2) {
    System.out.println("Thread 1: Holding lock 1 & 2...");
    }
    }
    }
    }

    private static class ThreadDemo2 extends Thread {
    public void run() {
    synchronized (Lock2) {
    System.out.println("Thread 2: Holding lock 2...");
    try { Thread.sleep(10); } // pause for 10 secs, then access thread
    catch (InterruptedException e) {} // if exception happens, “catch it”
    System.out.println("Thread 2: Waiting for lock 1..."); // display wait condition
    synchronized (Lock1) {
    System.out.println("Thread 2: Holding lock 1 & 2...");
    }
    }
    }
    }
    }

    Learn More

Items 1 to 10 of 13 total

per page
Page:
  1. 1
  2. 2

Grid  List 

Set Descending Direction
[profiler]
Memory usage: real: 15204352, emalloc: 14747488
Code ProfilerTimeCntEmallocRealMem