Discount ITS320 ITS 320 ITS/320 - NEWEST VERSION - Complete Course - Program #1 - Program #2 - Program #3 - Program #4 - Program #5 - Program #6 - Program #7
    ITS320 ITS 320 ITS/320 - NEWEST VERSION - Complete Course - Program #1 - Program #2 - Program #3 - Program #4 - Program #5 - Program #6 - Program #7 ITS320 ITS 320 ITS/320 - NEWEST VERSION - Complete Course - Program #1 - Program #2 - Program #3 - Program #4 - Program #5 - Program #6 - Program #7 ITS320 ITS 320 ITS/320 - NEWEST VERSION - Complete Course - Program #1 - Program #2 - Program #3 - Program #4 - Program #5 - Program #6 - Program #7

ITS320 ITS 320 ITS/320 - NEWEST VERSION - Complete Course - Program #1 - Program #2 - Program #3 - Program #4 - Program #5 - Program #6 - Program #7

$69.70
$92.93

JAVA program #1:

This simple exercise is meant to verify that you’ve properly installed Java SE and an IDE on your  computer so that you are ready for the later programming assignments in this class.

/**

 * Program #1 Function: Simple Java a pplication to demonstrate the behavior of

 * different data types, arithmetic, concatenation, and output of results.

 * Programmed By: Reggie Haseltine, instructor (July 18, 2009) Code Taken From:

 * "Java Programming (Fourth Editi on" by Joyce Farrell, Figure 2 - 26, page 61

 */

public class P1_Reggie {

    public static void main(String[] args) {

        int oneInt = 315;

        short oneShort = 23;

        long oneLong = 1234567876543L;

        int value1 = 43, value2 = 10, sum, difference, product, quotient, modulus;

        boolean isProgrammingFun = true;

        double doubNum1 = 2.3, doubNum2 = 14.8, doubResult;

        char myGrade = 'A', myFriendsGrade = 'C';

        System.out.println("Our grades are " + myGrade + " and "

                + myFriendsGrade);

        doubResult = doubNum1 + doubNum2;

        System.out.println("The sum of the doubles is " + doubResult);

        doubResult = doubNum1 * doubNum2;

        System.out.println("The product of the doubles is " + doubResult);

        System.out.println("The value of isProgrammingFun is "

                + isProgrammingFun);

        System.out.println("The value of isProgrammingHard is "

                + isProgrammingFun);

        System.out.println("The int is " + oneInt);

        System.out.println("The short is " + oneShort);

        System.out.println("The long is " + oneLong);

        sum = value1 + value2;

        difference = value1 - value2;

        product = value1 * value2;

        quotient = value1 / value2;

        modulus = value1 % value2;

        System.out.println("Sum is " + sum);

        System.out.println("Difference is " + difference);

        System.out.println("Product is " + product);

        System.out.println("Quotient is " + quotient);

        System.out.println("Modulus is " + modulus);

        System.out.println("\nThis is on one line\nThis on another");

        System.out.println("This shows\thow\ttabs\twork");

    }

    // end method main

}

Type in the following program source code from Joyce Farrell’s 4

Edition Java textbook to your IDE. Then modify the comments for your name and the current date, and change the class file name to reflect your first name. Then compile your code.

Then execute the .class file and verify that you get the following output.

JAVA program #2:

Custom BankAccount Class with a Modified Constructor

1) Enter the code for the two classes "BankAccount.java" and "Program2.java" shown below. The Program2 class is a driver for the BankAccount class. Note that this version of the BankAccount class accepts a monthly interest rate in decimal format which must be calculated by the user.

/**

 * BankAccount class This class simulates a bank account.

 *

 * (Taken from "Starting Out with Java-Early Objects (Third Edition) by Tony

 * Gaddis, 2008 by Pearson Educ.)

 *

 */

public class BankAccount {

    private double balance;

    // Account balance

    private double interestRate;

    // Interest rate

    private double interest;

 

    // Interest earned

    /**

     * The constructor initializes the balance and interestRate fields with the

     * values passed to startBalance and intRate. The interest field is assigned

     * to 0.0.

     */

     public BankAccount(double startBalance, double intRate) {

        balance = startBalance;

        interestRate = intRate;

        System.out.println("interestRate = " + interestRate);

        interest = 0.0;

    }

    /**

     * The deposit method adds the parameter amount to the balance field.

     */

    public void deposit(double amount) {

        balance += amount;

    }

    /**

     * The withdraw method subtracts the parameter amount from the balance

     * field.

     */

    public void withdraw(double amount) {

        balance -= amount;

    }

    /**

     * The addInterest method adds the interest for the month to the balance

     * field.

     */

    public void addInterest() {

        interest = balance * interestRate;

        balance += interest;

    }

    /**

     * The getBalance method returns t he value in the balance field.

     */

    public double getBalance() {

        return balance;

    }

    /**

     * The getInterest method returns the value in the interest field.

     */

    public double getInterest() {

        return interest;

    }

    public double getAnnualInterestRate() {

        return annualInterestRate;

    }

    public void setAnnualInterestRate(double annualInterestRate) {

        this.annualInterestRate = annualInterestRate;

    }

}

 

/**

 *

 *

 Colorado State University – ITS-320 –

 Basic Programming

 *

 * This program demonstrates the BankAccount class.

 *

 * (Taken from "Starting Out with Java- Early Objects

 * (Third Edition) by Tony Gaddis, 2008 by Pearson Educ.)

 *

 * Programmed by: Reggie Haseltine, instructor

 *

 * Date:

 June 19, 2010

 *

 */

 

import java.util.Scanner;

// Needed for the Scanner class

import java.text.DecimalFormat;

 

// Needed for 2 decimal place amounts

public class Program2 {

    public static void main(String[] args) {

        BankAccount account;

        // To reference a BankAccount object double balance,

        // The account's starting balance interestRate,

        // The annual interest rate pay,

        // The user's pay cashNeeded;

        // The amount of cash to withdraw

        // Create a Scanner object for keyboard input.

        Scanner keyboard = new Scanner(System.in);

        // Create an object for dollars and cents

        DecimalFormat formatter = new DecimalFormat("#0.00");

        // Get the starting balance.

        System.out.print("What is your account's " + "starting balance? ");

        balance = keyboard.nextDouble();

        // Get the monthly interest rate.

        System.out.print("What is your annual interest rate? ");

        interestRate = keyboard.nextDouble();

        // Create a BankAccount object.

        account = new BankAccount(balance, interestRate);

        // Get the amount of pay for the month.

        System.out.print("How much were you paid this month? ");

        pay = keyboard.nextDouble();

        // Deposit the user's pay into the account.

        System.out.println("We will deposit your pay " + "into your account.");

        account.deposit(pay);

        System.out.println("Your current balance is $"

                + formatter.format(account.getBalance()));

        // Withdraw some cash from the account.

        System.out.print("How much would you like " + "to withdraw? ");

        cashNeeded = keyboard.nextDouble();

        account.withdraw(cashNeeded);

        // Add the monthly interest to the account.

        account.addInterest();

        // Display the interest earned and the balance.

        System.out.println("This month you have earned $"

                + formatter.format(account.getInterest()) + " in interest.");

        System.out.println("Now your balance is $"

                + formatter.format(account.getBalance()));

    }

}

Compile the two test files (BankAccount.java first and then Program2.java second). Execute Program2 with the following inputs:

  • starting balance - $500 (don't enter the dollar sign)
  • monthly interest rate -0.00125 (this is a 1.5% annual rate)
  • monthly pay -$1000 (don't enter the dollar sign)
  • withdrawal amount -$900(don't enter the dollar sign)

Verify that you earn $0.75 in interest and have an ending balance at the end of the month of $600.75.

Then modify the BankAccountclass's constructor method to create a BankAccount object which stores a monthly interest when the user inputs an annual interest rate of the format "nnn.nn" (i.e.

1.5). Note that the BankAccount constructor stored a monthly interest rate for the BankAccount

object's instance field originally, but the user had to convert the annual rate to a monthly rate (i.e.

1.5 to 0.00125). Then modify the Program2 driver class to prompt the user for an Annual interest rate. Recompile both classes and execute the modified Program2 driver class again, this time

with following inputs:

  • starting balance -$500 (don't enter the dollar sign)
  • annual interest rate - 1.5
  • monthly pay -$1000  (don't enter the dollar sign)
  • withdrawal amount -$900 (don't enter the dollar sign)

Verify that you still earn $0.75 in interest and still have an ending balance at the end of the month of $600.75 as you did with the original code.

Submit only the modified source code files, final user inputs, and final output. Do not submit the original source code, inputs, and output.Be sure that you include the course, the program number, your name, and the date in your program header. Also include this information at the top of your Microsoft Word file. Include  additional comments as necessary and maintain consistent indentation for good programming style as shown and discussed in our text.

2) You may use the Windows Command Prompt command line interface or any Java IDE you

choose to compile and execute your program.

3) You are to submit the following deliverables to the Dropbox:

a) A single Microsoft Word file containing a screen snapshot of your Java source code for

both Program2.java and BankAccount.java (just the beginnings of the source code is OK) as it appears in your IDE (e.g. jGRASP, Net Beans, JDeveloper, etc.) or editor (e.g. a  DOS "more" of the .java file's first screen).

b) A listing of your entire modified version of the Java source code for Program2.java and BankAccount.java in the same Microsoft Word file as item a), and following item a). You can simply copy and paste the text from your IDE into Word. Be sure to maintain proper code alignment by using Courier font for this item. Do not submit the original source code files!

JAVA program #3:

Decision Control and Loops with User Interaction

1) Write a Java application that prompts the user for pairs of inputs of a product number (1-5), and then an integer quantity of units sold (this is two separate prompts for input values). You must use a switch statement and a sentinel – controlled loop (i.e. a loop that stops execution when an out of range value, such as -1, is input). All 15 items below are for a single purchase. There are five sets of inputs as follows:

Product 1    1 unit    (cost is $2.98 per unit)

Product 2    2 units  (cost is $4.50 per unit)

Product 3    3 units  (cost is $9.98 per unit)

Product 4    4 units  (cost is $4.49 per unit)

Product 5    5 units  (cost is $6.87 per unit)

Your application must calculate and display the total retail value of all products sold, after all 5

pairs of inputs are completed. You must also display the total after each new pair of input values

is entered. (This program was taken from Exercise 5.17 on page 228 of Deitel & Deitel's "Java How to Program (Sixth Edition)" (2005 by Pearson Publishing Co.))

2) You may use the Windows Command Prompt command line interface or any Java IDE you choose to compile and execute your program.

3) You are to submit the following deliverablesto the Assignment Dropbox in a single Microsoft Word file:

  • A screen snapshot of your Java source code (just the beginning is OK) as it appears in
  • your IDE (e.g. jGRASP, Net Beans, Eclipse, etc.) or editor (e.g. a Windows Command Prompt DOS "more" of the .java file's first screen).
  • A listing of your entire Java source code in the same Microsoft Word file as item a), and
  • following item a). You can simply copy and paste the text from your IDE into Word. Be
  • sure to maintain proper code alignment by using Courier font for this item.
  • A screen snapshot of your program’s input and output in the same Microsoft Word file,
  • and following item b). You must include screen snapshots of all inputs and all outputs,
  • not just a sample.

4) Your instructor may compile and run your program to verify that it compiles and executes

properly.

5) You will be evaluated on (in order of importance):

  • Inclusion of all deliverables in Step #3.
  • Correct execution of your program.
  • Adequate commenting of your code.
  • Good programming style (as specified in the textbook's examples).
  • Neatness in packaging and labeling of your deliverables

JAVA program #4:

  1. Write a program to assign the integer values 1 through 25 to a 25 element integer array.  Then, print the array as five separate lines each containing five elements separated by commas.  The last element on each line should be followed by a newline instead of a comma.  The output of your program should appear exactly as follows:

1,2,3,4,5
6,7,8,9,10
11,12,13,14,15
16,17,18,19,20
21,22,23,24,25

Hints:

  • One way to determine every 5th element is to use the modules operator (%).  If you divide the subscript by 5 and the remainder is 0, it is the 5th number.
  • You can use System.out.print() to print a value without a newline following it. This will allow you to print multiple things on the same line.
  1. You may use the Windows Command Prompt command line interface or any Java IDE you choose to compile and execute your program.
  2. You are to submit the following deliverables to the Assignment Dropbox in a single Microsoft Word file:
    • A screen snapshot of your Java source code (just the beginning is OK) as it appears in your IDE (e.g., jGRASP, Net Beans, Eclipse, etc.) or editor (e.g., a Windows Command line more of the .java file's first screen).
    • A listing of your entire Java source code in the same Microsoft Word file as item a), and following item a).  You can simply copy and paste the text from your IDE into Word.  Be sure to maintain proper code alignment by using Courier font for this item.
    • A screen snapshot of your program’s output in the same Microsoft Word file, and following item b). 
  3. Your instructor will compile and run your program to verify that it compiles and executes properly.
  4. You will be evaluated on (in order of importance):
    • Inclusion of all deliverables in Step #3.
    • Correct execution of your program.
    • Adequate commenting of your code.
    • Good programming style (as specified in the textbook's examples).
    • Neatness in packaging and labeling of your deliverables.

JAVA program #5:

Inheritance and Polymorphism

  1. Key in the PolyMain, Book, Almanac, and Novel classes defined in this module of the course.  Once you get each of these classes keyed in, make sure they compile and execute properly.  Then create a third subclass called Phone that also extends the Book class.  The Phone class should keep track of the number of yellow pages and the number of white pages in each phone book.  Make sure the Phone subclass you create has a print method having the same signature as the print method in the Book class.  The print method from the Phone class should print the title of the book, followed by the number of yellow pages and white pages contained within the phone book.  Thus, the print method should have the following signature:

public void print();

The Phone class should also have a constructor having the following signature:

public Phone(String title, int whitePages, int yellowPages);

This constructor should sum up whitePages + yellowPages to get the total number of pages in the book.  Remember the total pages in the book and the title of the book are set in the constructor for the Book class.

Modify the PolyMain class to create at least one of your phone books and store it in the library.  You should now be able to print the library without having to modify the print method defined within the PolyMain class.

JAVA program #6:

Create three exception classes named NumberHighException, NumberLowException, and NumberNegativeException.  Both NumberHighException and NumberLowException should be directly subclassed from the Exception class, but NumberNegativeException should be subclassed from NumberLowException.  You can use the BadDataException class that was defined in this module as the model for your exception classes.

Next create a class called Verify that will be used to validate that a number is within a specified range.  It should have one constructor that has 2 int parameters.  The 1st parameter is the minimum number in the range, and the 2nd parameter is the maximum number in the range.

In addition to the constructor, the Verify class should have one method that is named validate.  The validate method will have a single parameter of data type int.  The parameter contains the number that is being validated.  If the value of the parameter is less than zero, the method should throw a NumberNegativeException.  If the value is less than the minimum value of the range, it should throw a NumberLowException.  If the value is greater than the maximum value of the range, it should throw a NumberHighException.  If the value is within the specified range, no exception should be thrown.

Once all of these classes are created, create the driver class called Program5.  The driver class should instantiate a Verify object with a range of 10 to 100.  It should then do the following:

  • Prompt the user to input a number within the specified range.
  • Use a Scanner to read the user input as an int.  You can ensure that an int was entered because the nextInt method in the validate class throws an InputMismatchException if any non digits are entered.
  • Call the validate method to validate that the number is within the range.
  • Print an appropriate error message if the value is not within the range, or print the value if it is within the range

JAVA program #7:

Create a class called BankAccount.  The BankAccount class should contain a String to store the customer name and a double to store the account balance.  The BankAccount class should have 2 constructors as follows:

    public BankAccount(String name, double balance)
                       throws NegativeAmountException
    {
        // set name and balance
        // make sure balance is not negative
        // throw exception if balance is negative
    }

    public BankAccount(String name)
                       throws NegativeAmountException
    {
        // set name and use 0 balance
    }

As can be seen, the first constructor throws a NegativeAmountException if the balance being used to create the bank account is negative.  You will have to create this exception class yourself.

The BankAccount class should also contain methods to make a deposit, make a withdrawal, get the current balance, and print a bank account statement.  The interfaces for these methods should appear as follows:

    // update balance by adding deposit amount
// make sure deposit amount is not negative
// throw exception if deposit is negative
    public void deposit(double amount)
           throws NegativeAmountException

    // update balance by subtracting withdrawal amount
// throw exception if funds are not sufficient
// make sure withdrawal amount is not negative
// throw NegativeAmountException if amount is negative
// throw InsufficientFundsException if balance < amount
    public void withdraw(double amount)
       throws InsufficientFundsException, NegativeAmountException

    // return current balance
    public double getBalance()

    // print bank statement including customer name
// and current account balance
    public void printStatement();

Use the BankAccount class as the superclass for a SavingsAccount class.  In addition to the behaviors of a BankAccount, a SavingsAccount also accumulates interest,  therefore the SavingsAccount class contains a double that is populated with the current interest rate.  In addition to its constructors (you decide what the constructors should be), the SavingsAccount class should contain the following methods:

    // post monthly interest by multiplying current balance
// by current interest rate divided by 12 and then adding
// result to balance by making deposit
    public void postInterest()

    // print bank statement including customer name
// and current account balance (use printStatement from
// the BankAccount superclass)
// following this also print current interest rate
public void printStatement()

Once these two classes are completed, create a driver class called FinalExam containing a main method that tests the SavingsAccount class.  Within the driver test class, create a SavingsAccount object and then use it to make deposits, withdrawals, and to post the monthly interest. 

To make the program simpler, you can incorporate the initial data for the Savings Accounts directly in the program (e.g., no need to prompt for the account holder name or starting balance).  The only things you need to prompt for are the deposit amount and the withdrawal amount.  Also, to simplify the task, the only exceptions that you should handle are the NegativeAmountException and the InsufficientFundsException.  If either of these exception conditions occurs, print an appropriate error message and terminate the application.  You can simply re-throw any IOExceptions from the main.

Complete solution for ITS320 course

Using java language

it is 100% correct solution !!!

If you have more questions, please contact me via email support@extutorials.com

I will help you any time

Thank you

Attached Files

Move over [ preview ] file name to preview content in it!

  • ITS320-Newest-Solution.zip [3011KB]
    • ITS320-Assignment#1
      • Document.docx [642.3KB]
      • source code
        • FirstName.java [2KB] [ preview ]
    • ITS320-Assignment#2
      • Document.docx [191.4KB]
      • source code
        • BankAccount.java [2KB] [ preview ]
        • Program2.java [2.5KB] [ preview ]
    • ITS320-Assignment#3
      • Document.docx [240.2KB]
      • source code
        • CheckOutSystem.java [2.1KB] [ preview ]
    • Java program #4
    • Java program #5
      • Document.doc [390.1KB] [ preview ]
      • ITS320-Java-Program-5-ScreenShot.jpg [165.9KB]
      • Program 5.doc [27.6KB] [ preview ]
      • souce code
        • Almanac.java [0.5KB] [ preview ]
        • Book.java [0.3KB] [ preview ]
        • Novel.java [0.2KB] [ preview ]
        • PolyMain.java [0.5KB] [ preview ]
    • Java program #6
      • Document.doc [270.3KB] [ preview ]
      • ITS320-Program-6-ScreenShot-1.jpg [76.9KB]
      • ITS320-Program-6-ScreenShot-2.jpg [76.8KB]
      • ITS320-Program-6-ScreenShot-3.jpg [78.1KB]
      • source code
        • BadDataException.java [0.4KB] [ preview ]
        • NumberHighException.java [0.3KB] [ preview ]
        • NumberLowException.java [0.3KB] [ preview ]
        • NumberNegativeException.java [0.3KB] [ preview ]
        • Program5.java [0.7KB] [ preview ]
        • Verify.java [1.4KB] [ preview ]
    • Java program #7
      • Document.docx [252.9KB]
      • ITS320-Program-7-ScreenShot.jpg [97.4KB]
      • source code
        • BankAccount.java [1.6KB] [ preview ]
        • FinalExam.java [1.3KB] [ preview ]
        • InsufficientFundsException.java [0.3KB] [ preview ]
        • NegativeAmountException.java [0.3KB] [ preview ]
        • SavingsAccount.java [1.4KB] [ preview ]

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B