PDA

View Full Version : Help regarding Java project



lilyoungfella
09-15-2008, 03:25 AM
Okay. I was given a problem/s on my programming1 subject. Anyone who has any idea on how to solve this?



PROBLEM 1:

BANK

A bank in your town updates its customerís accounts at the end of each month. The bank offers two types of accounts: savings and checking. Every customer must maintain a minimum balance. If a customerís balance falls below minimum, there is a service charge of 50 pesos for savings accounts with minimum balance of 3000 and 100 pesos for checking accounts with minimum balance of 2000 pesos. If the balance at the end of the month is at least the minimum balance, the account receives interest as follows:

* Savings accounts receive 4% interest.
* Checking accounts with balances of up to 5,000 pesos receives 3% interest; otherwise, the interest is 5%.

The program should read a customerís account number, account type, minimum balance that the account number should maintain, and the current balance. The program should then output the account number, account type, current balance, and appropriate message.

Inputs:

Enter account number:
Choose account type [S] Savings [C] Checking
Enter minimum balance:
No. of months:



Output:

1713542
S
4000
3

The account number is 1713542.
The account type is Savings.
The minimum requirement for this account is 3000.
Your current balance is: 4480



----------

PROBLEM 2

(Hint: use search for the use of "pow", java.lang.Math and java.text)

Write a program to show how a mortgage on a house will be paid off (amortized) over a certain number of years given the amount of the mortgage, the proposed annual payment, and the annual interest rate charged. The input must be coming from the user, using the keyboard as input device. Prepare a table showing the amount of interest and capital paid in each year, and the final balance owing at the yearís end. Label the columns of the table and also show the total interest paid during the amortization.

Formula:

or this could be translated to:

variable= ((1-1/pow(1+interest, noyears))/interest)



Sample Output:

Enter amount of mortgage: 1000

Enter interest rate (in decimal format): 0.05

Number of years to pay: 5

YEAR PAYMENT INTEREST 0.05% PRINCIPAL O/B
1 230.975 50.000 180.975 819.025
2 230.975 40.951 190.024 629.002
3 230.975 31.450 199.525 429.477
4 230.975 21.474 209.510 219.976
5 230.975 10.999 219.976 0.000



-----

Problem 3

To make telephone numbers easier to remember, some companies uses letter to show their telephone number. Foe example, using letters, the telephone number 438-5626 can be shown as GET LOAN. In some cases, to make a telephone number meaningful, companies might use more than 7 letters. For example, 225-5466 can be displayed a CALL HOME, which uses eight letters. Write a program that prompts a user to enter a telephone number expressed in letters and outputs the corresponding telephone number in digits. If the user enters more than 8 letters, then process only the seven letters. Also output the Ė (hyphen) after the third digit. Allow the user to use uppercase and lowercase letters.
(Hint: You can read the entered telephone number as string and then use the charAt method of the class String to extract each character. For example, if str refers to a string, then the expression str.charAt(i) returns the character at the ith position. Recall that in string, the position of the first character is 0.)

(See your cellphone for the numbers and letters guide).

Sample Run: In this sample run.

Sample Run1:

Enter letters:

CALL FIRE


The telephone number in digits is:
225-5347

Sample Run2:

Enter letters:

GET CASH


The telephone number in digits is:
438-2274

djr33
09-15-2008, 04:10 AM
First, please use a descriptive title so we know what you're asking about.
Second, as a general policy, we don't do homework for people. If you have a specific question, you can ask, but if not, there is a reason for homework-- it's practice, and that's how you'll learn.

peter_budo
09-15-2008, 04:30 PM
Grab copy of Java How to Program 6th or 7th edition from Deitel & Deitel and start reading. This is classic school or book scenario intended to explaining Java basics and learn...

magicyte
09-15-2008, 10:46 PM
I hate homework. Although - I do sometimes do homework for other people ;).

-magicyte

ddadmin
09-16-2008, 12:34 AM
What Daniel said. I'm closing this uthread. We can only help with a specific problem within your code, not simply help you write your assignment. That's called cheating.