Question

Need help in trying to get my java program to work, Its finished but i still...

Need help in trying to get my java program to work, Its finished but i still have errors left when i compile

WHy do i get this error message"Illegal start of expression void displaysummary() " When i try to complie my java program ?


import java.io.*;
  
public class prog23
{
   public static void main(String[] args) throws I0Exception
   {
       program23 app = new program23();
       app.appMain();
   }
}
class program23
{
  
   BufferedReader stdin;

       int custNum;
       float begBal, overDraft;
       String monthEnd;
      
       int transNum;
       char transType;
       String transDate, overPenalty;
       float transAmt;
      
       float runBal, totCredits, totDebits, totOverAmt;
       int creditTransCtr, lowDebitNum;
       float lowDebitAmt, avgCredit;
      
void appMain() throws I0Exception
{
       reportHeader();
       initReport();
       getAccountInfo();
       initRunningBal();
      
       while (transNum != 0)
       {  
               procTrans();
       }
       calculateAverage();
       displaySummary();
}

void reportHeader()
{

   System.out.print("******************************************\n");
   System.out.println("Program 23 Solution");
  
  
   System.out.println("******************************************\n");
}

void initReport()
{
      
       stdin = new BufferedReader(new InputStreamReader(System.in));
      
       totCredits = 0;
       totDebits = 0;
       creditTransCtr = 0;
       totOverAmt = 0;
       lowDebitAmt = 5001;
       transNum = -11;
}
void getAccountInfo() throws I0Exception
{
       System.out.print("Please enter the account number: ");
       custNum = Integer.parseInt(stdin.readLine());
      
       System.out.print("Please enter the beginning balance for the account: ");
       begBal = Float.parseFloat(stdin.readLine());
      
       System.out.print("Please enter the month end date for this cycle: ");
       monthEnd = stdin.readLine();
      
       System.out.print("Please enter the overdraft penalty amount: ");
       overDraft = Float.parseFloat(stdin.readLine());
}  
      
void initRunningBal()

{
   runBal = begBal;
}

void procTrans() throws I0Exception
{
   getTransNum();
   if (transNum != 0)
   {
           getTransDetails();
           calculateTotalsAndRunBal();
           calculateOverdraftAndPenalty();
           displayTransDetails();
   }
}

void getTransNum() throws I0Exception
{
   System.out.print("\n\nPlease enter the Transaction Number: ");
   transNum = Integer.parseInt(stdin.readLine());
}

void getTransDetails() throws I0Exception
{
       System.out.print("Please enter the Trans Type: ");
       transType = (stdin.readLine().charAt(0));
      
       System.out.print("Please enter the Trans Amount: ");
       transAmt = Float.parseFloat(stdin.readLine());
}

void calculateTotalsAndRunBal()
{
   if (transType == 'C')
   {
           runBal = runBal + transAmt;
           totCredits = totCredits + transAmt;
           creditTransCtr = creditTransCtr + 1;
   }

   if (transType == 'c')
   {
       runBal = runBal + transAmt;
       totCredits = totCredits + transAmt;
       creditTransCtr = creditTransCtr + 1;
   }
  
   if (transType == 'D')
   {
       runBal = runBal - transAmt;
       totDebits = totDebits + transAmt;
       updateLows();
   }
   if (transType == 'd')
   {
           runBal = runBal - transAmt;
           totDebits = totDebits + transAmt;
           updateLows();
   }
}

void calculateOverdraftAndPenalty()
{
   if(runBal < 0)
   {
           runBal = runBal - overDraft;
           totOverAmt = totOverAmt + overDraft;
          
           overPenalty = Float.toString(overDraft);
   {
   else

   {
           overPenalty = "";
   }
}

void updateLows();
{

       if(transAmt < lowDebitAmt)
       {
               lowDebitAmt = transAmt;
               lowDebitNum = transNum;
       }
}

void displayTransDetails();
{
       System.out.println("\n\n\n");
       System.out.println("Customer Transaction:");
       System.out.println( "===========================");
       System.out.println("Transaction #: \t\t" + transNum);
       System.out.println("Transaction Type: \t" + transType);
       System.out.println("Transaction Amt: \t" + transAmt);
       System.out.println("Running Balance: \t" + runBal);
       System.out.println("Over Draft Penalty Amt:\t" + overPenalty);
       System.out.println( "============================");
}

void calculateAverage();
{
       avgCredit = totCredits / creditTransCtr;
}
void displaySummary();
{
       System.out.println("\n\n");
      
       System.out.println("******************************************");  
       System.out.println("****MASCO Monthly Transaction Report Summary****");   
       System.out.println("Customer Account Number: \t\t" + custNum);
       System.out.println("Customer Beginning of Month Balance: \t" + begBal);
       System.out.println("Monthly Transaction Report Ending on: \t" + monthEnd);
       System.out.println("Overdraft Penalty Amount: \t\t" + overDraft);
       System.out.println("******************************************");
       System.out.println("***************************************");
       System.out.println("Customer End Balance:\t" + runBal);
       System.out.println("Total Credits $ Amount:\t" + totCredits);
       System.out.println("Total Debits $ Amount: \t" + totDebits);
       System.out.println("Total Overdraft Amount:\t" + totOverAmt);
       System.out.println("Average Credit Amount: \t" + avgCredit);
       System.out.println();
       System.out.println("Low Debit $ Amount: \t" + lowDebitAmt);
       System.out.println("Low Debit Trans #:\t" + lowDebitNum);
       System.out.println("*******************************");  
       System.out.println("*******************************");  
   }
}

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Need help in trying to get my java program to work, Its finished but i still...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • I need help with my IM (instant messaging) java program, I created the Server, Client, and...

    I need help with my IM (instant messaging) java program, I created the Server, Client, and Message class. I somehow can't get both the server and client to message to each other. I am at a roadblock. Here is the question below. Create an IM (instant messaging) java program so that client and server communicate via serialized objects (e.g. of type Message). Each Message object encapsulates the name of the sender and the response typed by the sender. You may...

  • Explain this java code, please. import java.util.Scanner; public class Program11 { public static void main(String[] args)...

    Explain this java code, please. import java.util.Scanner; public class Program11 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); final int maxSize = 128; String[] titles = new String[maxSize]; int[] lengths = new int[maxSize]; int numDVDs = 0; String op; op = menu(stdIn); System.out.println(); while (!op.equalsIgnoreCase("q")) { if (op.equalsIgnoreCase("a")) { if (numDVDs < maxSize) numDVDs = addDVD(titles, lengths, numDVDs, stdIn); } else if (op.equalsIgnoreCase("t")) searchByTitle(titles, lengths, numDVDs, stdIn);    else if (op.equalsIgnoreCase("l")) searchByLength(titles, lengths, numDVDs, stdIn); System.out.println('\n');...

  • I need help with adding comments to my code and I need a uml diagram for...

    I need help with adding comments to my code and I need a uml diagram for it. PLs help.... Zipcodeproject.java package zipcodesproject; import java.util.Scanner; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Zipcodesproject { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner input=new Scanner(System.in); BufferedReader reader; int code; String state,town; ziplist listOFCodes=new ziplist(); try { reader = new BufferedReader(new FileReader("C:UsersJayDesktopzipcodes.txt")); String line = reader.readLine(); while (line != null) { code=Integer.parseInt(line); line =...

  • Using java socket programming rewrite the following program to handle multiple clients simultaneously (multi threaded programming)...

    Using java socket programming rewrite the following program to handle multiple clients simultaneously (multi threaded programming) import java.io.*; import java.net.*; public class WelcomeClient { public static void main(String[] args) throws IOException {    if (args.length != 2) { System.err.println( "Usage: java EchoClient <host name> <port number>"); System.exit(1); } String hostName = args[0]; int portNumber = Integer.parseInt(args[1]); try ( Socket kkSocket = new Socket(hostName, portNumber); PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), true); BufferedReader in = new BufferedReader( new InputStreamReader(kkSocket.getInputStream())); ) { BufferedReader...

  • Java: Hello, can someone please find a way to call my arraylist "list" and linkedhashmap called...

    Java: Hello, can someone please find a way to call my arraylist "list" and linkedhashmap called "jobMap" in my main method instead of calling them in the 2 classes? Also, is there a way to avoid the "Suppress Warning" portion in RoundRobin.java? I haven't been able to find a way for some reason. This is a job scheduling program, so the output should give the same values. To run: javac Main.java, java Main 5jobs.txt . txt file will be provided...

  • I need help understanding this programming assignment. I do not understand it at all. Someone provided...

    I need help understanding this programming assignment. I do not understand it at all. Someone provided me with the code but when I run the code on eclipse it gives an error. Please explain this assignment to me please. Here is the code: import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class TextEditor { public static List<String> lines = new ArrayList<String>(); public static void main(String[] args) throws IOException { Scanner s = new...

  • If I enter a negative value the program throws an error and the withdrawal amount is...

    If I enter a negative value the program throws an error and the withdrawal amount is added to the balance please help me find why? public abstract class BankAccount { private double balance; private int numOfDeposits; private int numOfwithdrawals; private double apr; private double serviceCharge; //Create getter and setter methods public double getBalance() { return balance; } public void setBalance(double balance) { this.balance = balance; } public int getNumOfDeposits() { return numOfDeposits; } public void setNumOfDeposits(int numOfDeposits) { this.numOfDeposits =...

  • can some one help me solve this and explain it please Input Format A line indicating...

    can some one help me solve this and explain it please Input Format A line indicating the size of the array the array on the next line Constraints n < 10000 Output Format One line printing the array in order input (given to you) One line printing the array, followed by its maximum value Sample Input 0 5 1 3 5 7 9 Sample Output 0 1 3 5 7 9 9 7 5 3 1 9 Contest ends in...

  • Hi I need help with a java program that I need to create a Airline Reservation...

    Hi I need help with a java program that I need to create a Airline Reservation System I already finish it but it doesnt work can someone please help me I would be delighted it doesnt show the available seats when running the program and I need it to run until someone says no for booking a seat and if they want to cancel a seat it should ask the user to cancel a seat or continue booking also it...

  • I need to write a program in java that reads a text file with a list...

    I need to write a program in java that reads a text file with a list of numbers and sorts them from least to greatest. This is the starter file. import java.util.*; import java.io.*; public class Lab3 { static final int INITIAL_CAPACITY = 5; public static void main( String args[] ) throws Exception { // ALWAYS TEST FOR REQUIRED INPUT FILE NAME ON THE COMMAND LINE if (args.length < 1 ) { System.out.println("\nusage: C:\\> java Lab3 L3input.txt\n"); System.exit(0); } //...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT