Commit a911463c authored by a-j.towse's avatar a-j.towse

second commit

parent c1191516
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}
## Getting Started
Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
## Folder Structure
The workspace contains two folders by default, where:
- `src`: the folder to maintain sources
- `lib`: the folder to maintain dependencies
Meanwhile, the compiled output files will be generated in the `bin` folder by default.
> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
## Dependency Management
The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
public class App {
public static void main(String[] args) throws Exception {
System.out.println("Hello, World!");
}
}
public class SavingsAccount {
int accountNumber;
String name;
double balance;
public SavingsAccount(){
accountNumber = 0;
name = "N/A";
balance = 0;
}
public SavingsAccount(int accnum, String accname, double accbalance){
accountNumber = accnum;
name = accname;
balance = accbalance;
}
public void deposit(double inAmount){
balance = balance + inAmount;
}
public void withdrawal(double outAmount){
if (outAmount <= balance || outAmount > 0 || outAmount <= 100){
balance = balance - outAmount;
}
}
public void accrueInterest(){
double interest = balance * 0.05;
balance += interest;
}
public void display(){
System.out.println(accountNumber);
System.out.println(name);
System.out.println(balance);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment