EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 8, Problem 10PE

Explanation of Solution

Program:

File name: “CertOfDeposit.java

//Import necessary header files

import java.time.LocalDate;

//Define a class named CertOfDeposit

public class CertOfDeposit

{

    //Declare the private variables

    private int certificateNumber;

    private String lastName;

    private double balance;

    private LocalDate issueDate;

    private LocalDate maturityDate;

    /*Define a constructor that sets the instance variables

    to class CertOfDeposit */

public CertOfDeposit(int certificateNumber,String lastName,double balance, LocalDate issueDate)

    {

        //Refers to the instance variables

        this.certificateNumber=certificateNumber;

        this.lastName=lastName;

        this.balance=balance;

        this.issueDate=issueDate;

        this.maturityDate=issueDate.plusYears(1);

    }

    //Define a method that sets the certificate number

    public void setCertificateNumber(int certificateNumber)

    {

        this.certificateNumber=certificateNumber;

    }

    //Define a method that sets the last name

    public void setLastName(String lastName)

    {

        this.lastName=lastName;

    }

    //Define a method that sets the balance amount

    public void setBalance(double balance)

    {

        this.balance=balance;

    }

    //Define a method that sets the issue date

    public void setIssueDate(LocalDate issueDate)

    {

        this.issueDate=issueDate;

    }

    //Define a method that sets the maturity date

    public void setMaturityDate(LocalDate maturityDate)

    {

        this.maturityDate=maturityDate;

    }

    //Define a method that returns the certificate number

    public int getCertificateNumber()

    {

        //Return the value

        return certificateNumber;

    }

    //Define a method that returns the last name

    public String getLastName()

    {

        //Return the value

        return lastName;

    }

    //Define a method that returns the balance amount

    public double getBalance()

    {

        //Return the value

        return balance;

    }

//Define a method that returns the issue date as LocalDate object

    public LocalDate getIssueDate()

    {

        //Return the value

        return issueDate;

    }

//Define a method that returns the maturity date as LocalDate object

    public LocalDate getMaturityDate()

    {

        //Return the value

        return maturityDate;

    }

}

File name: “CertOfDepositArray.java

//Import necessary header files

import java.time.LocalDate;

import java.util.Scanner;

//Define a class named CertOfDepositArray

public class CertOfDepositArray

{

    //Define a main method

    public static void main(String[] args)

    {

        //Declare the variables

        int certificateNumber;

        String name;

        double balance;

        int day;

        int month;

        int year;

        final int size=5;

        //Create an object for Scanner class

        Scanner scanner=new Scanner(System...

Blurred answer
Students have asked these similar questions
PLEASE SOLVE STEP BY STEP WITHOUT ARTIFICIAL INTELLIGENCE OR CHATGPT I don't understand why you use chatgpt, if I wanted to I would do it myself, I need to learn from you, not from being a d amn robot. SOLVE  STEP BY STEP I WANT THE DIAGRAM PERFECTLY IN SIMULINK
I need to develop and run a program that prompts the user to enter a positive integer n, and then calculate the value of n factorial n! = multiplication of all integers between 1 and n, and print the value n! on the screen. This is for C*.
I need to develop and run a C* program to sum up integers from 1 to 100, and print out the sum value on the screen. Can someone help please?
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning