Results 1 to 8 of 8
Like Tree4Likes
  • 1 Post By Fubarable
  • 1 Post By AndrewM16921
  • 1 Post By Fubarable
  • 1 Post By Fubarable

Thread: Create a program for car credit customers

  1. #1
    thehulkk is offline Member
    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Exclamation Create a program for car credit customers

    I'm taking a java class in college, and I"m having a hard understanding java, but still wan to learn and overcome these challenges. I would like someone to help me build this program with a head start. I'm new to this site, I hope I can find help here, the assignment is as follow:

    Create an interface class called FinancingRates. This should include final variables for the rates of different length of loans: 1 year, 3 year and 7 year. Short term loans should have lower rates. Include a maximum loan amount. Do not allow loans over $50,000.
    Create Financing class, as abstract to implement the FinancingRates interface. You should have a borrower name, account number, loan amount and how many years the financing is for, defined in the constructor. Also include variable for financingrateMake a toString() method that prints all the information.
    Create two subclasses of Financing: One for good credit and one for bad. For the good credit have the constructor set the loan amount to be .65% over the current applicable. financingRate. For the Bad credit have it be 2.15% over the current applicable financingRate.
    Finally create an application that creates the financing using arrays. Prompt users for the information about financing rates. Then prompt users to create for information to create a specific financial record. Display that record when done.

    I'm going to start on it right now and I'll post the code I create later.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Create a program for car credit customers

    Welcome. Please show us what you've got when you've got it, and if you get stuck, please feel free to ask specific questions that come up.
    DarrylBurke likes this.

  3. #3
    thehulkk is offline Member
    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Default Re: Create a program for car credit customers

    I created the interface class I'm not sure if I need to put anything else in there. Also my other question is if I'm supposed to put it inside a main type, like static void main, or it's not needed in this kind of program. This is just the beginning, I know I'm know completely done.

    My mistake, the interface goes on a different java file, so I edited the original class, now I have a FinancingRates.Java

    Java Code:
    public interface FinancinRates {
    	public double LoanOne();
    	public double LoanTwo();
    	public double loanThree();
    	public double MaxLoan();
    
    }
    Last edited by thehulkk; 02-23-2013 at 03:30 AM.

  4. #4
    AndrewM16921 is offline Senior Member
    Join Date
    Jan 2009
    Location
    NJ, USA
    Posts
    263
    Rep Power
    6

    Default Re: Create a program for car credit customers

    Your professor may or may not want you to define the interface inside of a class. An interface can be defined in its own file, just like a class. Second, an interface is meant for the soul purpose of inter-object communication - that is to say, no actual implementation is placed there. As it stands, the interface is fine. Though the assignment does require it include some final fields, so you will want to add those in.

    As for the "main method" (public static void main), this is simply to tell java where to start the program. In fact, most code you write as a java developer will not be inside the main method. For anything to actually happen, you will need a main method (possibly in a separate file). But an interface certainly does not need to be accompanied by one.

    The "Financing" class should implement this interface. When you declare it, you write "public class Financing implements FinancingRates", and you will then be forced to implement those four methods you included. However, if you make the class abstract then you do not need to (but you can) implement those methods.

    I hope this helps you get a bit further with the assignment.
    thehulkk likes this.

  5. #5
    thehulkk is offline Member
    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Default Re: Create a program for car credit customers

    the is the code in I started in the other file. I'm a little stuck here, What code do I use to convert the interface class to string?
    Java Code:
    /*
     * Author:
     * Date : 2/22/12
     */
    
    public class Financing implements FinancinRates  {
    	String borrower = "Carlos Giraldo";
    	String AccNumber = "56783";
    	double YearFin = 7;
    		
    	}
    Last edited by thehulkk; 02-23-2013 at 04:05 AM.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Create a program for car credit customers

    1. Get rid of the abstract modifier in the class signature.
    2. Read up in the tutorials on use of interfaces. The key being if your concrete class implements an interface, it must implement every method of that interface.
    3. Do not nest one class inside of another class without a specific reason such as a small class that is only used internally. You definitely don't have the need here, and it will only add unneeded complexity and possible error.
    4. Please have a look at the link in my signature below on use of code tags when posting in the forum so that your code does not lose its formatting and we can read your formatted code more easily.
    Last edited by Fubarable; 02-23-2013 at 03:55 AM.
    thehulkk likes this.

  7. #7
    thehulkk is offline Member
    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Default Re: Create a program for car credit customers

    Thanks for all the responces this is what I got so far thanks also for Eclipse tips

    Java Code:
    /*
     * Author:
     * Date : 2/22/12
     */
    
    public class Financing implements FinancinRates  {
    	String borrower = "Carlos Giraldo";
    	String AccNumber = "56783";
    	double YearFin = 7;
    	
    	public double LoanOne() {
    		
    		return 0;
    	}
    	
    	public double LoanTwo() {
    		
    		return 0;
    	}
    	
    	public double loanThree() {
    		
    		return 0;
    	}
    	
    	public double MaxLoan() {
    		
    		return 0;
    	}
    		
    		}
    Last edited by thehulkk; 02-23-2013 at 04:19 AM.

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Create a program for car credit customers

    Quote Originally Posted by thehulkk View Post
    Thanks for all the responces this is what I got so far thanks also for Eclipse tips

    Java Code:
    /*
     * Author:
     * Date : 2/22/12
     */
    
    public class Financing implements FinancinRates  {
    	String borrower = "Carlos Giraldo";
    	String AccNumber = "56783";
    	double YearFin = 7;
    	
    	public double LoanOne() {
    		
    		return 0;
    	}
    	
    	public double LoanTwo() {
    		
    		return 0;
    	}
    	
    	public double loanThree() {
    		
    		return 0;
    	}
    	
    	public double MaxLoan() {
    		
    		return 0;
    	}
    		
    		}
    Quote Originally Posted by thehulkk View Post
    Create an interface class called FinancingRates. This should include final variables for the rates of different length of loans: 1 year, 3 year and 7 year. Short term loans should have lower rates. Include a maximum loan amount. Do not allow loans over $50,000.
    Where are your final variables? So far the instructions make no mention of methods that the interface may need to implement, so I'm not sure why you're doing this.

    Create Financing class, as abstract to implement the FinancingRates interface.
    Sorry, I was wrong. Financing should in fact be abstract.

    You should have a borrower name, account number, loan amount and how many years the financing is for, defined in the constructor.
    Note the *defined in the constructor* part.

    Also include variable for financingrateMake a toString() method that prints all the information.
    You look to have bad typographical errors here. Please fix.

    Create two subclasses of Financing: One for good credit and one for bad. For the good credit have the constructor set the loan amount to be .65% over the current applicable. financingRate. For the Bad credit have it be 2.15% over the current applicable financingRate.
    This is pretty self explanatory.

    Finally create an application that creates the financing using arrays. Prompt users for the information about financing rates. Then prompt users to create for information to create a specific financial record. Display that record when done.[
    Again, self explanatory.
    thehulkk likes this.

Similar Threads

  1. Create customers with unique personNumber
    By ostkanten in forum New To Java
    Replies: 14
    Last Post: 08-23-2012, 03:12 PM
  2. Credit() crediting customers account
    By JavaB in forum New To Java
    Replies: 1
    Last Post: 04-08-2012, 12:33 AM
  3. Credit Limit Calculator
    By Nightcrawler in forum New To Java
    Replies: 5
    Last Post: 03-05-2012, 02:49 AM
  4. limit disk space for my customers accounts
    By mtz1406 in forum Java Servlet
    Replies: 6
    Last Post: 04-04-2010, 04:38 PM
  5. Credit Card Validator
    By bluegti02 in forum New To Java
    Replies: 2
    Last Post: 06-17-2008, 06:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •