I'm writing a program but I don't understand the question that well could someone help explain what I have to do. Also, I am having difficulty making the methods could someone help, because I am getting an error every time.
This is the Question.
Write a cash register class. It should have the following methods:
AddTransaction(amount) – add an amount to a running total and increments the number of transactions
TransactionCount() – returns the number of transactions received
Total() – returns to total amount of the orders
ResetTransactions() – sets the total amount and transaction count to 0
Register Count() – returns the number of cash registers created
Next, write an application that instantiates at least two register objects to prove that your class works.
P.S.: Don't worry about storing each individual order.
My code is:
package cashregister;
import java.io.*;
public class CashRegister
{
public static void main(String[] args)
{
AddTransaction call = new AddTransaction();
System.out.println("the answer is" + call);
public static void AddTransaction()
{
String one = "";
for (int i = 0; i <10;)
{
i++;
one += i;
}
System.out.println(one);
}
public static void TransactionCount()
{
AddTransaction count = new AddTransaction;
}
public static void Total()
{
}
public static void ResetTransactions()
{
}
public static void RegisterCount()
{
}
}
}