Design a class named Account that contains:
■ A private int data field named id for the account (default 0).
■ A private double data field named balance for the account (default 0).
■ A private double data field named annualInterestRate that stores the current interest rate (default 0). Assume all accounts have the same interest rate.
■ A private Date data field named dateCreated that stores the date when the account was created.
■ A no-arg constructor that creates a default account.
■ A constructor that creates an account with the specified id and initial balance.
■ The accessor and mutator methods for id, balance, and annualInterestRate.
■ The accessor method for dateCreated.
■ A method named getMonthlyInterestRate() that returns the monthly interest rate.
■ A method named withdraw that withdraws a specified amount from the account.
■ A method named deposit that deposits a specified amount to the account.
Write a test program that creates an Account object with an account ID of 1122, a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the deposit method to deposit $3,000, and print the balance, the monthly interest, and the date when this account was created.
JAVA小程序编写,求大神救急
\/\/IO_001.javaimport java.io.*;public class IO_001{ public staic void main(String[] args)throws IOException{ BufferedWriter bw = new BufferedWriter(new FileWriter("file.txt",true)); bw.write("文件已被创建成功!"); bw.newLine(); bw.write("又添加了一行文字"); ...
用Java编程序!十万火急!谢了
param args \/ public static void main(String[] args) { for(int i=1;i<=9;i++){ \/\/ for(int j=1;j<=i;j++){ System.out.print(j+"*"+j+"="+i*j);System.out.print(" ");if(j==i){ System.out.print("\\n");} } } } } ...
急急急!JAVA编程题,哪位大神可以帮助一下我,十分感谢
public class ThreadA extends Thread {@Overridepublic void run() {System.out.println("I am XXX");}} ThreadB.java:public class ThreadB extends Thread {@Overridepublic void run() {System.out.println("I love XXX");}} Main.java:public class Main {public static void main(String...
急急急 求大神 Java编程 ,从键盘输入十个同学的3门功课的成绩,并输出...
intScores[i] = strs[i][3];System.out.println("第"+(i+1)+"个同学的成绩(最后一个数为总数):"+Arrays.toString( strs[i] ));} Arrays.sort(intScores); \/\/从低到高排序 StringBuffer sb = new StringBuffer();for(int i=intScores.length-1;i>=0;i--){ sb.append( int...
急!!!用Java编写以下程序:
然后将这些语句组合成一个Java应用程序,计算并打印整数从1到10的累加和。要求程序中使用自增语句,用while结构循环执行计算。循环应该在变量x的值为11时终止。public class Du { public static void main(String[] args) { int sum;int x;sum = 0;x = 1;while (x < 11) { sum = sum + ...
求一个简单的JAVA程序,急!!!
private double[] 职称等级={0.8,0.9,1.0,1.1,1.2,1.3,1.4};public int get职称() { return 职称;} public void set职称(int 职称) { this.职称 = 职称;} public Teacher(String ns, String ps) { super(ns, ps);} public double counting() { return this.get课时()*职称...
帮忙用java基础语言编写一个程序 要求如下
import java.util.List;public class QuestionOne { \/ 打开一个文本文件,每次读取一行内容。将每行作为一个String读入,并将那个String对象置入一个Linkedlist中。按相反的顺序打印出Linkedlist中所有的行。同样也打开一个文本文件,以便将文本写入其中。将Linkedlist中的各行随同行号一起写入文件。 很急 请...
用java编一个程序,要求如下,希望哪位大虾帮帮忙,很急!!!
import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.ButtonGroup;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JRadioButton;import javax.swing....
Java 代码 求大神帮助十万火急!!
public static void main(String[] args) {Scanner input = new Scanner(System.in);ArrayList<Integer> L = new ArrayList<>(10);int X = 1;int Y = 0;while (true) {if(L.size()>=10)break;System.out.printf("Integer " + X + ":", (X + 1));X++;Y++;L.add(input.next...
急!求教Java高手!以下是我的Java代码,我在注释中写明了我的想法,和问题...
import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.io.*;class jfr extends JFrame { String getpath;String gettype;String getname;JTextField jf1 = new JTextField();\/\/ 接收用户输入的文件夹路径 JTextField jf2 = new JTextField();\/\/ 接收用户输入的文件夹下...