Welcome to AssignmentCache!

Search results for 'cit-150 chapter5 individual case'

Items 1 to 10 of 36 total

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

Grid  List 

Set Descending Direction
  1. PRG 421 Week 3 Learning Team Fundraiser Initial program

    PRG 421 Week 3 Learning Team Fundraiser Initial program

    $12.00

    Learning Team Instructions Fundraiser Program
    A city is sponsoring a run to support local charities and would like an application to track the pledges. The result will be a database that holds data on individuals, total pledges obtained, and the charity for which the donation is designated.
    Design and implement a GUI-based program to accept a participant’s name, the amount pledged, and the designated charity’s name. The program will store these data for later retrieval.

    PRG 421 Week 3 Learning Team Initial program
    Create a GUI-based program to accept name of donor, name of charity, and amount of pledge from the user.
    Display a list of entries in a JTextArea or JTable.
    Submit the .java source file for this program.

    Learn More
  2. PRG 421 Fundraiser program with Data file

    PRG 421 Week 4 Learning Team Fundraiser Program Instructions Add a Data File

    $12.00

    Learning Team Instructions Fundraiser Program
    A city is sponsoring a run to support local charities and would like an application to track the pledges. The result will be a database that holds data on individuals, total pledges obtained, and the charity for which the donation is designated.
    Design and implement a GUI-based program to accept a participant’s name, the amount pledged, and the designated charity’s name. The program will store these data for later retrieval.

    PRG 421 Week 4 Learning Team Instructions Add a Data File
    Modify the program you created in Week Three to write the data—name, amount, and charity—into a sequential data file.
    Implement a capability of reading what is in the existing data file and displaying it in the text area.
    Submit the .java source file for the program.

    Learn More
  3. PRG 421 Week 3 Learning Team Fundraiser with java DB

    PRG 421 Week 5 Learning Team Fundraiser Program Connect to a Database

    $15.00

    Learning Team Instructions Fundraiser Program
    A city is sponsoring a run to support local charities and would like an application to track the pledges. The result will be a database that holds data on individuals, total pledges obtained, and the charity for which the donation is designated.
    Design and implement a GUI-based program to accept a participant’s name, the amount pledged, and the designated charity’s name. The program will store these data for later retrieval.

    PRG 421 Week 5 Learning Team Connect to a Database
    Write a program to create a database from the data in the sequential file you created in Week Four.
    Modify the GUI to connect to this database and add entries to it and read entries from it. Entries read from the database should be displayed in the JTextArea or JTable.
    Test and debug this final program.
    Submit the .java source file or files.

    Learn More
  4. CIS355A iLab 3 Step 1 Cylinder Java Programs

    CIS355A iLab 3 Cylinder and Date Java Programs

    $15.00

    CIS355A iLab 3 Cylinder and Date Java Programs

    In This lab you will create two programs that use classes and methods.

    Deliverables
    Program files for each of the following two programs
    1. Cylinder
    2. Date

    iLAB STEPS
    STEP 1: Cylinder
    Create a class called Cylinder.java that contains two double-precision instance variables named radius and height. The class should include a constructor that initializes the radius and height variables. Also, you need a class method named volume() that returns the volume of a Cylinder object. The volume of a cylinder is given by its radius squared times its height times Pi (radius * radius * height * Math.PI). You can either use the value 3.1416 for Pi or use the Java provided value named Math.PI.
    Write a class called CylinderTest.java and declare an array of three Cylinder objects to call the methods you declared in the Cylinder class. Make sure that all class methods are called from main(). Have main() display the value returned by volume() and verify the returned value by hand calculations (paper/pencil). Prompt the user to enter the values for the radius and height of each Cylinder object in the array.


    STEP 2: Date (20 points)
    Create a program called Date.java to perform error-checking on the initial values, for instance: fields month, day, and year. Also, provide a method nextDay() to increment the day by one. The Date object should always remain in a consistent state.
    Write a program called DateTest.java that prompts the user to enter the month, day, and year as numeric values. This program then creates a Date object using the Date class you just created and tests the nextDay() method. This can be done in a loop of 40 iterations: the Date object calls the nextDay() method and prints the date during each iteration of the loop. This loop is to illustrate that the nextDay() method works correctly. Test the following cases:
    a. Incrementing into the next month, for example, use date: 02/28/2011
    b. Incrementing into the next year, for example, use date: 11/27/2011
    c. Incrementing into the next month in a leap year, for example, use date: 02/28/2012
    Sample Program Output:
    Checking increment
    Date object constructor for date 11/27/2011
    Incremented Date:11/28/2011
    Incremented Date:11/29/2011
    Incremented Date:11/30/2011
    Day 31 invalid. Set to day 1.
    Incremented Date:12/1/2011
    Incremented Date:12/2/2011
    ...
    Incremented Date:12/30/2011
    Incremented Date:12/31/2011
    Day 32 invalid. Set to day 1.
    Incremented Date:1/1/2012
    Incremented Date:1/2/2012
    Incremented Date:1/3/2012
    Incremented Date:1/4/2012
    Incremented Date:1/5/2012
    Incremented Date:1/6/2012

    Learn More
  5. CIS355A iLab 4 Step 2 InheritanceTest Java Programs

    CIS355A iLab 4 InheritanceTest DayGui and OfficeAreaCalculator Java Programs

    $15.00

    CIS355A iLab 4 InheritanceTest DayGui and OfficeAreaCalculator Java Programs

    In this lab, you will create one project that uses inheritance and two simple Graphical User Interfaces (GUI) programs.

    Deliverables
    Program files for each of the following three programs
    1. InheritanceTest
    2. DayGui
    3. OfficeAreaCalculator

    iLAB STEPS
    STEP 1: InheritanceTest (20 points)
    Write a program called InheritanceTest.java to support an inheritance hierarchy for class Point-Square-Cube. Use Point as the superclass of the hierarchy. Specify the instance variables and methods for each class. The private variable of Point should be the x-y coordinates. The private data of Square should be the sideLength. The private data of Cube should be depth. Each class must provide applicable accessor, mutator, and toString() methods for manipulating private variables of each corresponding class. In addition, the Square class must provide the area() and perimeter() methods. The Cube must provide the area() and volume() methods.
    Write a program that instantiates objects of your classes, ask the user to enter the value for x, y, and sideLength, test all instance methods and outputs of each object’s perimeter, area, and volume when appropriate.

    STEP 2: DayGui (10 points)
    Write a program called DayGui.java that creates a GUI having the following properties
    Object Property Setting
    JFrame Name Caption Layout mainFrame Messages FlowLayout
    JButton Name Caption Mnemonic cmdGood Good G
    JButton Name Caption Mnemonic cmdBad Bad B
    Add individual event handlers to your program so that when a user clicks the Good button, the message "Today is a good day!" appears in a dialog box, and when the Bad button is clicked, the message "I'm having a bad day today!" is displayed. The following tutorial shows you much of the code solution. Feel free to use the tutorial, but make changes so that you are not simply copying the tutorial code for your entire solution. To make this different from the tutorial, change the colors of the buttons and panel. Also, add this application to a tabbed pane along with the program you will complete in the next step, Step 3. The following tutorials will likely be useful as you work to complete this step:
    • JTabbedPane
    • Tutorial to Write Your First GUI

    STEP 3: OfficeAreaCalculator (10 points)
    Write a program called OfficeAreaCalculator.java that displays the following prompts using two label components
    • Enter the length of the office:
    • Enter the width of the office:
    Have your program accept the user input in two text fields. When a button is clicked, your program should calculate the area of the office and display the area in a text field with a label of Area. This display should be cleared whenever the input text fields receive the focus. A second button should be provided to terminate the application (Exit button).
    The following tutorial shows you much of the code solution. Feel free to use the tutorial, but make changes so that you are not simply copying the tutorial code for your entire solution. To make this different from the tutorial, change the colors of the panel. Also, add this application to the same tabbed pane (see the JTabbedPane tutorial) as the application you built in Step 2, the DayGui application.
    • Office Area Calculator Tutorial

    Learn More
  6. 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
  7. CMIS 141 Project 3 Stringed Musical Instrument Java Class

    CMIS 141 Project 3 Stringed Musical Instrument Java Class and UML class diagram

    $25.00

    CMIS 141 Project 3 Stringed Musical Instrument Java Class and UML class diagram

    This project focuses on demonstrating your understanding of classes and objects. Before attempting this project, be sure you have completed all of the reading assignments listed in the syllabus to date, participated in the weekly conferences, and thoroughly understand the examples throughout the chapters. The project requirements include:

    1. Design and implement a stringed musical instrument class using the following guidelines:
    a. Data fields for your instrument should include number of strings, an array of string names representing string names (e.g. E,A,D,G), and boolean fields to determine if the instrument is tuned, and if the instrument is currently playing. You are welcome to add additional data fields if you like.
    b. A constructor method that set the tuned and currently playing fields to false.
    c. Other methods 1) to tune the instrument, 2) to start the instrument playing, and 3) to stop the instrument from playing.
    d. Other methods as you see fit (Add at least one unique method).

    2. Create a UML class diagram using a diagram tool (e.g. PPT, Visio) of your choice. Prepare the diagrams and place them in a word document along with a brief description of each of your classes.

    3. Create Java classes for your instruments. Be sure that your code matches your design specifications and some minimal functionality is included. For example, if you called the violin.play() method, you should at least print that the violin is playing. Similar functionality should be supplied when you stop playing, tune or call any of your methods. For example:

    public void playviolin() {
    System.out.println("The violin is now playing.");
    }

    4. Write the output from your Instrument class methods to a text file that a user entered from the command line arguments (e.g. java Mynamep3tst myfilename.txt). This allows your program to accept filenames from the user via a command line argument.

    5. Finally, create a Java test class that simulates using your instrument class. In your test class be you should at a minimum: a) Construct 10 instances of your instrument, b) tune your instruments, c) Start playing your instrument, d) Call your unique method, and e) Stop playing your instruments. (Hint: Arrays and Loops will make your job easier and result in more efficient code!)

    6. Your programs should compile and run without errors.

    7. Be sure to test your program carefully. Provide a list of comprehensive test cases used to validate your application and include these test cases in your word document containing your UML diagrams and descriptions. Similar to Project 1, your test data can be shown in a table that includes input data, expected output, actual output and pass/fail results from the test.

    Learn More
  8. LastWord Java Program

    LastWord Java Program

    $5.00

    LastWord Java Program

    1 LastWord.java
    You will write a Java program with the file name LastWord.java. The purpose of this program is to scan through a file and find in the file:
    1. The word that is closest to the beginning of the dictionary
    2. The word that is closest to the end of the dictionary
    3. The longest word
    For the purpose of this program, a word is defined as a string of characters delimited by whitespace that starts with a letter and ends with a letter. If a string of character delimited by whitespace that starts with one or more non-letters, they should be trimmed until the first character is a letter. Same should be done to the trailing non-letters. For example, the string of character “quote” should be trimmed to quote, --dash-- should be trimmed to dash. The non-letter enclosed by letters should be left alone. This definition of a word may make your English teachers cringe, but will be much easier to implement.
    The lexicographical order of the words can be determined simply by using the compareToIgnoreCase() method of String class.
    The input file name should be entered by a JOptionPane input dialog box.
    2 Suggested Procedure
    1. Start the program by popping up an input dialog box to ask user for a file name.
    2. Instantiate a FileReader using the file name wrapped in a BufferedReader.
    3. nstantiate a FileWriter wrapped in a BufferedWriter.  The output file name may be hardcoded.
    4. Test the program by reading the input file and write the input to the output file. Compare the input file and output file.
    5. Instantiate a Scanner that scans the BufferedReader. By default the Scanner delimits the tokens by whitespaces. Write the scanned tokens, one per line, to the output file. Exam the output file.
    6. Write a new public class named WordSmith.  Create a static method trim() to remove the non-letters around the words. Test WordSmith.trim() until you are satisfied.
    7. Back to LastWord, between Scanner output and write to output, insert a call to WordSmith.trim(). Create a test file with all the possible scenarios you can think of.  It will be more effective if you write out the word before and after trim() is called side-by-side on the same line.
    8. Consider sharing your test file at DocSharing.
    9. Add the code to LastWord to find the first word, last word, and the longest word.
    10. Use JOptionPane.showMessageDialog() to display the results. Show the file name used in the title of the dialog box.

    Deliverables
    Source file(s): LastWord.java and WordSmith.java

    Learn More
  9. Find and print out all the palindromes in a file Java Program

    Find and print out all the palindromes in a file Java Program

    $20.00

    Find and print out all the palindromes in a file Java Program

    Find and print out all the palindromes in a file, ignoring any strings with numbers in them, and printing them out in alphabetical order. Your program should:
    1. Open the file, dealing with possible exceptions
    If there is no file name given, print "insufficient arguments given"
    If there is no file, print "file not found"

    2. Read the file word by word, where words are any strings of characters separated by whitespace. For example "ghoud3421" is a word, but as it contains digits you would not test to see if it is a palindrome.

    3. For each word, use a separate method to see if it contains digits, and if it does not, check using another method whether it is a palindrome.

    4. Collect all the palindromes, including duplicates.

    5. Print out all the palindromes in alphabetical order.

    A palindrome is a word whose meaning may be interpreted the same way in either forward or reverse direction. e.g. dad, tattarrattat, abccba, abbba, aba.
    Learning Outcomes

    File I/O
    String manipulation
    Using the Java Collections

    Sample Input/Output
    Case A
    Input: java PalindromeCounter
    Output: insufficient arguments given

    Case B
    Input: java PalindromeCounter nofile
    Output: file not found

    Case C
    Input: java PalindromeCounter file1.txt
    file1.txt:
    abcd a1a aa1 a
    ccc
    a !#! z#z %1%
    haah Zaz

    Output:
    !#!
    a
    a
    ccc
    haah
    z#z

    Skeleton Code
    textpop-up
    public classPalindromeCounter {
    public static void main(String[] args) {
    // TODO fill in this method
    }
    protected static boolean isValidWord(Stringword) {
    // TODO fill in this method
    }
    protected static boolean isPalindrome(Stringword) {
    // TODO fill in this method
    }
    }

    Learn More
  10. 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

Items 1 to 10 of 36 total

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

Grid  List 

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