The bank already has a Java application. But they want certain new features to be added and some existing functionality to be changed as per their new policies. For this, Angelina needs to address the following issues: [20 Marks]
1. There is a class named Accounts which calculates the interest on a particular account. The following code snippet generates compilation error: [5 Marks]
class Accounts
int principal; // Data members of the class
int interest;
int time;
int amt;
public Accounts ()
principal = 50000;
interest = 5;
time = 3;
return principal, interest, time;
public void calc()
amt= principal*interest*time/100;
System.out.println(“The amount is :” + amt);
public static void main(String args[])
Accounts l1= new Accounts ();
What is the cause of error? Give reasons in support of your answer
4 Years
Discussion Span
Last Post by Shoes Mosh

Iamthwee is correct, we don't. If you post whatever code you have written yourself, and ask a meaningful question about how to complete the project, we should be able to help, but we will not do your work for you.


just try to compile it, and see for yourself.
it's one line that 'll block. if you know just the least bit of your course, you'll easily spot it.

if you don't, you haven't read your coursenotes.


plis guys help me out of this am an amateur in java so i have been given this assignment...i know you can help me..

the problem i found is that 'void method does not return a value'.

Edited by Shoes Mosh

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.