Concept explainers
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...
Trending nowThis is a popular solution!
- Given the schema below for the widgetshop, provide a schema diagram. Schema name Attributes Widget-schema Customer-schema (stocknum, manufacturer, description, weight, price, inventory) (custnum, name, address) Purchased-schema (custnum, stocknum, pdate) Requestedby-schema (stocknum, custnum) Newitem-schema (stocknum, manufacturer, description) Employee-schema (ssn, name, address, salary) You can remove the Newitem-schema (red).arrow_forwardTrue or False: Given the sets F and G with F being an element of G, is it always ture that P(F) is an element of P(G)? (P(F) and P(G) mean power sets). Why?arrow_forwardCan you please simplify (the domain is not empty) ∃xF (x) → ¬∃x(F (x) ∨ ¬G(x)). Foarrow_forward
- HistogramUse par(mfrow=c(2,2)) and output 4 plots with different argument settings.arrow_forward(use R language)Scatter plot(a). Run the R code example, and look at the help file for plot() function. Try different values for arguments:type, pch, lty, lwd, col(b). Use par(mfrow=c(3,2)) and output 6 plots with different argument settings.arrow_forward1. Draw flow charts for each of the following;a) A system that reads three numbers and prints the value of the largest number.b) A system reads an employee name (NAME), overtime hours worked (OVERTIME), hours absent(ABSENT) and determines the bonus payment (PAYMENT).arrow_forward
- Scenario You work for a small company that exports artisan chocolate. Although you measure your products in kilograms, you often get orders in both pounds and ounces. You have decided that rather than have to look up conversions all the time, you could use Python code to take inputs to make conversions between the different units of measurement. You will write three blocks of code. The first will convert kilograms to pounds and ounces. The second will convert pounds to kilograms and ounces. The third will convert ounces to kilograms and pounds. The conversions are as follows: 1 kilogram = 35.274 ounces 1 kilogram = 2.20462 pounds 1 pound = 0.453592 kilograms 1 pound = 16 ounces 1 ounce = 0.0283 kilograms 1 ounce = 0.0625 pounds For the purposes of this activity the template for a function has been provided. You have not yet covered functions in the course, but they are a way of reusing code. Like a Python script, a function can have zero or more parameters. In the code window you…arrow_forwardmake a screen capture showing the StegExpose resultsarrow_forwardWhich of the following is not one of the recommended criteria for strategic objectives? Multiple Choice a) realistic b) appropriate c) sustainable d) measurablearrow_forward
- Management innovations such as total quality, benchmarking, and business process reengineering always lead to sustainable competitive advantage because everyone else is doing them. a) True b) Falsearrow_forwardVision statements are more specific than strategic objectives. a) True b) Falsearrow_forwardThe three components of the __________ approach to corporate accounting include financial, environmental, and social performance measures. Multiple Choice a) stakeholder b) triple dimension c) triple bottom line d) triple efficiencyarrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning