Home Tutorialhelp Comment Programming question

 
 

Comment

mkcjoh001@uct.ac.za
Programming question,
April 9, 2008 at 2:52 AM

Write a SavingsAccount class to store the following information related to a bank account:

Account number, Password, Branch name, Surnames, First names, Balance

The account balance should be able to reflect cents as well as rands. Assume the balance for a new account is at first 0.

No instance variable should be directly accessible/modifiable from outside the class. Use appropriate accessor and mutator methods.

Your class must include the following methods:

initialiseAccount (accountNumber, password, branch, surnames, firstNames) to store initial values.
toString () to display all information in the instance except the password and balance.
withdrawCash (amount) to lower the account balance if there is money available and return 0. If there are insufficient funds the method must leave the balance unchanged and return -1.
depositCash (amount) to increase the balance.
changeUserPassword (oldPassword, newPassword) to change the password and return 0. If the old password does not match what is in the object, the method must return -1 and leave the password unchanged.
Your Question2 driver class must first ask the user for account informatiom, then provide the user with an interactive menu to perform tasks as indicated in the sample output. The driver class must print out suitable messages as indicated.

Sample I/O


Enter Account Number102Enter Branch NameRondeboschEnter SurnamesMacGregorEnter First NamesKennethEnter your Account Passwordfoo------------Account Operation Menu----------0. Quit1. View account details2. Withdraw cash3. Deposit cash/cheque4. View balance5. Change user passwordEnter user operation number1Account Number: 102Branch: RondeboschName: Kenneth MacGregor------------Account Operation Menu----------0. Quit1. View account details2. Withdraw cash3. Deposit cash/cheque4. View balance5. Change user passwordEnter user operation number3Enter Amount to deposit2400Deposit successful------------Account Operation Menu----------0. Quit1. View account details2. Withdraw cash3. Deposit cash/cheque4. View balance5. Change user passwordEnter user operation number4Balance: R2400.00------------Account Operation Menu---------0. Quit1. View account details2. Withdraw cash3. Deposit cash/cheque4. View balance5. Change user passwordEnter user operation number2Enter amount to withdraw3500Insufficient funds------------Account Operation Menu---------0. Quit1. View account details2. Withdraw cash3. Deposit cash/cheque4. View balance5. Change user passwordEnter user operation number2Enter amount to withdraw500Withdrawal successful------------Account Operation Menu----------0. Quit1. View account details2. Withdraw cash3. Deposit cash/cheque4. View balance5. Change user passwordEnter user operation number4Balance: R1900.00------------Account Operation Menu----------0. Quit1. View account details2. Withdraw cash3. Deposit cash/cheque4. View balance5. Change user passwordEnter user operation number5Enter old passwordflaEnter new passwordbarOld password does not match------------Account Operation Menu----------0. Quit1. View account details2. Withdraw cash3. Deposit cash/cheque4. View balance5. Change user passwordEnter user operation number5Enter old passwordfooEnter new passwordbarPassword change successful------------Account Operation Menu----------0. Quit1. View account details2. Withdraw cash3. Deposit cash/cheque4. View balance5. Change user passwordEnter user operation number0Bye
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

Java Programming Question
Java Programming Question  Write a program in Java to create a menu bar with the help of event handlers.   Hi Friend, Try this: import javax.swing.*; import java.awt.event.*; public class SwingMenuBar{ public 

Java Beginners

Assignment Question on java programming
Assignment Question on java programming  Can somone help me on this . Thx You are required to write a complete Java program for a simple grading system. At the beginning of the system, you need to input number of students 

Java Beginners

help me to solve this question
help me to solve this question   A user needs to key in data... Course Code Course Name Session Semester STIA1013 Basic Programming... Name : Basic Programming Lecturer Id Lecturer Name Session Semester 

Java Beginners

socket programming question
socket programming question   can you respond to me the multiple clients chat application java code and a server that manages the clients using the socket programming in java 

Java Beginners

socket programming question
socket programming question   can you respond to me the multiple clients chat application java code and a server that manages the clients using the socket programming in java 

Java Beginners

socket programming question
socket programming question   can you respond to me the multiple clients chat application java code and a server that manages the clients using the socket programming in java 

Java Beginners

Java Programming Question
Java Programming Question  write a program in java to show thread working with sleep and wait method   Hi Friend, Please visit the following links: Wait Method Sleep Method Thanks 

Java Beginners

question
question  Good Afternoon Sir, Please give me a client Server Socket programming using jsp and java with mysql connection 

Java Magazine Questions

programming question - Java Magazine
programming question  I have an SGVT map displaying on a phone emulator but then want to search for a given location on the map and display that particular location when typed in the interface Or could display the whole map 

Java Beginners

Java Programming Question
Java Programming Question  Write a program in Java to accept 10 different numbers an store it in text file.   Hi Friend, Try this: import java.io.*; import java.util.*; class AcceptNumbers{ public static void main 

Java Beginners

programming question - Java Beginners
programming question  Create a class named Movie that can be used with your video rental business. The Movie class should track the Motion Picture Association of America (MPAA) rating (eg., Rated G, PG-13, R), ID Number 

Java Beginners

Java Programming Question
Java Programming Question  Write a program in Java to create student information form an submit detail in database.   Hi Friend, Try this: import java.awt.*; import java.sql.*; import javax.swing.*; import 

Java Beginners

core java programming question
core java programming question  How to write a java program to list the customer names arrived to a restuarant on a particular date in alphabetical order with arguments as 1 filename yymmdd cust   Hi Friend, Try 

JSP Interview Questions

question
question  Gud morning sir, I have asked u some question regarding... then the other one should become optional.This is the problem sir.please help me regarding this promblem. please help me as soon as possible sir.. Thanks for sending 

Java Beginners

question
question  Sir, Please help me to develop a simple search engine model in java , send me some codes 

Java Beginners

question
question  i need a mysql query to take a difference in between current time and previous time.please help me 

Java Beginners

question
question  i need to set trigger using jsp with mysql query,please help me 

Java Beginners

Java Programming Help
Java Programming Help  Hello ! I m the student of last year and i need your help to complete my java project. I going to make a site like youtube... with controls .. I Just want to use jsp and applet in my project . Please help me 

Java Beginners

question
question  Good afternoon Sir, i need a code to inser url in to table using mysql + jsp Please help me it's urgent 

Java Beginners

question
question  i need a mysql query to take a difference in between current time and previous time from date time colomn in table.please help me 

Java Beginners

Question
Question  Sir, please help me to write a JAVA program to read data from keyboard up to names and sort in alphabetical order using bubble sort 

Java Beginners

question
question  Sir, How to stream video on one computer which is playing on another PC in LAN using java + socket / RMI . if you have any idea about that please help me and give the source code 

Java Beginners

question
question  Sir, how to display web snippets for a perticular query for eg:web snippets for apple how to implement this concept in my java project please help me 

Java Beginners

question
question  Sir , i have a starting trouble to start my search engine project , please help me to start my project , please send me some relevant java codes 

Java Beginners

question
question  please help me to correct the problem in following one JFmeasure newContentPane = new JFmeasure(d,recall,sfme); **error : Multiple markers at this line - JFmeasure cannot be resolved to a type 

Java Beginners

question
question  i am using following one .please give me the correct one.i used grigorian calendar if(hour<=13) { i couldn't worked with this if condition please help me 

Java Beginners

question
question  i need a mysql query to take a time in between current time and previous time from date time colomn in table.please help me View Answers 

Java Beginners

question
question  i need a mysql query to take a date in between current date and previous date from date time colomn in table.please help me View Answers View Answers 

Java Beginners

question
question  sir, i need a jsp+mysql query to select data from two table for a perticular user eg:select data from employee and leave table for john.please help me 

Java Beginners

question
question  i wan't to set a trigger in attendance table after a fixed time interval.colomns in attendance are name emp_id date ip status.please help me .i am using mysql 

Java Beginners

question
question  i am using this code in my project response.sendRedirect("LoginForm1.jsp?msg=Username or Password is incorrect!"); but i wan't to hide this message from url.please help me 

Java Beginners

question
question  I have a project named demo using eclipse but while we are trying to run there is an error like type :Status report message : /demo/ description: The requested resource (/demo/) is not available. Please help me 

PHP Questions

question
question  Sir, could you please help me to write a php program to display the contents of html registration form in a php page but i need to verify the phone number is number or not and also verify the email is valid 

Java Beginners

question
question  Good Afternoon Sir, could you please tell me about what is real process happened in "A DISTRIBUTED PROTOCOL TO SERVE DYNAMIC GROUPS FOR PEER-TO-PEER STREAMING" what is actually happened in this ,please help me 

Java Beginners

question
question  i have a project for search engine .i have a starting trouble , from where do i start project ,please help me.when i am given a key word to search ,which must return title,summary and url and i want to capture 

Java Beginners

question
question  i need to get select count(*) from leavetable where empid=400 in between two dates from timestamp colomn please help me for eg:2011-06-01 10:49:01 and 2011-06-30 10:49:01 

Java Beginners

question
question  i need to mark employees as half day absent who came after 10'o clock in my web project,so i need to know who are all late entry.if you have any idea using jsp and mysql please help me 

Java Beginners

question
help me 

Java Beginners

question
help me 

Java Beginners

question
in this please help me 

Java Beginners

question
. Please help me 

JSP Servlet Questions

Question
Question  sir I am creating a user defined custom tag in net beans ide but I am unable to run the code sucessfully . I got internal server error plz help me   Please visit the following links: http://www.roseindia.net 

Java Beginners

question
button i want to close the window. please help me to create this and send me 

Java Beginners

question
table. i wan't to list employees on leave in current date.please help me,send me 

Java Beginners

question
wan't to display the employees on leave in current date.please help me and send me 

Java Beginners

question
wan't to display the employees on leave in current date.please help me and send me 

Java Beginners

question
/) is not available.** how tdo i solve this.please help me to run my project please give 

Java Beginners

question
connection. please help me to create this and send me the source code using Java 

Java Beginners

question
to implement these all in a java , please help me Note:?web-snippet? denotes the title 

Java Beginners

question
question  i am using this code in my project response.sendRedirect("LoginForm1.jsp?msg=Username or Password is incorrect!"); but i wan't to hide this message from url.please help me. you gave me the response Hi Jamsiya 

Java Beginners

question
in to client window. please help me to create this and send me the source code using Java Swing   I think this will help you, try this package 

Java Beginners

question
of frame . please help me to create this and send me the source code using Java 

Java Beginners

question
question  Dear Sir, How do i solve the following problems , i am using jdk1.6.0_22 and eclipse Helios , please help me ................ Access restriction: The type Player is not accessible due to restriction on required 

JSP Interview Questions

question
question  hi good morning. how to retrive the data from one form of jsp to another form.please help me   Hi Friend, Try the following code: 1)form1.jsp: <html> <form method="post" action="form2.jsp"> < 

Java Beginners

Need Help in Java programming
Need Help in Java programming  Hello. Can someone please help me with writing the following program Java program that gives assignment details such as:assignment number,assignment name,due date,submission date,percentage marks 

Java Beginners

help
help  i can't answer this question....state 2 different array processing which use loops 

Java Beginners

help me to solve this question...
help me to solve this question...  Given below is a class definition for Book. Type and compile the class, and answer the following questions: class Book { String title; //book‚??s title double price; //book‚??s 

Java Beginners

Java Programming Code HELP
Java Programming Code HELP  Hi, sir/madam. I am new here... the expert can help me to solve this problem and pull out the attribute name. Can sir/madam help me check where is the problem...and help me to fix it..thanks a lot 

Java Beginners

pls help me with this question
pls help me with this question  how to write a program in C++ using encapsulation,polymorphism,inheritance and abstraction?(all these concepts should come in a single program 

Java Beginners

Need help in java programming
Need help in java programming  Hello. Can someone please help me with writig the following programm. Assignment 20% Presentation 10% Mini Test 10% Exam 60% Java program that accepts the following details: student 

Java Beginners

help me to solve this question
help me to solve this question  Write a program that inputs a series of integers into an array. The numbers are in the range 0 to 100. Calculate and display : a) The Largest number b) The Smallest Number c)The sum of the numbers 

Java Beginners

plz help me for this question
plz help me for this question  Apply simplex procedure to solve the L.P.P. maximize z = 3x1 + 4x2 subject to 5x1 + 4x2 ‚?§ 200; 3x1 + 5x2 ‚?§ 150; 5x1 + 4x2 ‚?• 100; 8x1 + 4x2 ‚?≠‚?• 80, x1 ‚?• 0, x2 ‚?• 0 

Java Beginners

Help!
Help!  thanks for ur code, I'd like to ask a question: after press "c" or "C", timer starts and after every delay ms, it'll print "This line is printed only once." or just print once. I'm writting a timer but it seems to perform 

Java Beginners

help
fine and gives the correct answer. my question is why wont it compile and, how 

JSP Servlet Questions

programming - JSP-Servlet
with oracle database in JBoss application server. I want to retrieve question from database. For the first question I did it successfully.But I want to retrieve next question when click on next button in jsp page and that question 

Java Interview Questions

help
(); } } SFDV2103 ‚?? Java Programming Fall, 2012 Term Project... on the percentage of cheating. SFDV2103 ‚?? Java Programming Fall, 2012 Term... based on the percentage of cheating. please help me 

Java Beginners

Java programming question - Java Beginners
Java programming question   Give the definition of a class named Doctor whose objects are records for a clinic's doctors. This class will be derived class of the class SalariedEmployee that is given below the question. A Doctor 

JSP Servlet Questions

Help
are correct"); %> I am new to this programming and I want to know how can I 

Java Beginners

Java programming question - Java Beginners
Java programming question  I want to write a program that converts temperatures from celsius to fahrenheit and vice versa. It also converts kilometers to miles and vice versa using "methods".  Hi Friend, Try 

Java Beginners

Java programming using ArrayList Help?
Java programming using ArrayList Help?  Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program... row index : 2 The largest column index : 2,3 Any help would be greatly 

Java Beginners

Java programming using ArrayList Help?
Java programming using ArrayList Help?  Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program... The largest row index : 2 The largest column index : 2,3 Any help would be greatly 

Java Beginners

hi need help with C++ programming!
hi need help with C++ programming!  how do i : b. Store numbers / characters into the file (output) c. Retrieve numbers / characters from the file (input thanks!   b) #include <iostream> #include < 

Java Beginners

Java Programming Need Help ASAP
Java Programming Need Help ASAP  You are required to develop a student menu system that is similar to the bank system covered in class..., their year (you can assume they all start in year 1), their programming mark 

JSP Servlet Questions

Programming Help URGENT - JSP-Servlet
Programming Help URGENT  Respected Sir/Madam, I am R.Ragavendran. I am in urgent need of the coding. My requirement is as follows: Beside... TO ROSEINDIA TEAM< IF I GET THIS HELP IN TIME.... Thanks/Regards 

Java Beginners

Urgent java programming question.Pls help
Urgent java programming question.Pls help  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list 

Java Beginners

Netbeans Question need help desperately!!
Netbeans Question need help desperately!!   Ok here is my code- public class RollDie2 { public static void main(String[] args) { Random randomNumber = new Random(); int[][] frequency = new int[9][9]; int die1 = 0; int 

Java Beginners

help with substring in c programing
help with substring in c programing  Hi I could not found programming in C in the "select category" so I am posting my question in java section. Please help with substring function,prompt the user for two strings and display 

Java Beginners

Craps Game Java Programming Help
Craps Game Java Programming Help  Craps is a casino game that involves the throwing of a pair of dice. Based on the throw, the thrower either gets... roll. You may wish to print the roll sequence to help you debug. Output 

Java Beginners

Java programming help - Java Beginners
Java programming help  Write a program that asks the user for an integer, and if the input is positive, puts stars on the screen - one star on line one, two stars on line two, three stars on line three, and so on until 

Java Beginners

java programming - Java Beginners
java programming  Hi Buddies, i want java Array ,looping questions.Can somebody please give the questions? n one more thing the question... will come like that structure   Hi friend, Code to help 

Java Beginners

plz help meto solve this question
plz help meto solve this question  for a file that exist what will be the length() method in the file class return 

JavaMail Questions

sir i,have a another assignment for these question plz help me sir - JavaMail
sir i,have a another assignment for these question plz help me sir  ... a scientific calculator using event-driven programming paradigm of Java. 3... to both. plz help me sir 

JSP Servlet Questions

Programming help Very Urgent - JSP-Servlet
Programming help Very Urgent  Respected Sir/Madam, Actually my code shows the following output: There is a combo box which contains all the ID's present in the database.. When I click or select any of the ID,it automatically 

Java Beginners

Java help - Java Beginners
Java help  I didnot get the code ,therefore I am posting my question again.. Thanks in advance ...:) Programming Assignment: A) Consider the outpatient pharamacy at University Hospital. At the entrance of the pharmacy 

Java Beginners

Java programming help with files - Java Beginners
Java programming help with files  I want a code or the following program .thanks Write a program that reads employee data into a vector. The data is composed of : - id# - name - nationality - job title the program 

Java Interview Questions

interview question plz help me and thers
interview question plz help me and thers  A college is good if it satisfies the following conditions: 1.Its number of students is greater than 1000. 2.If the name ends wih a character 'e', then it should not start with character 

Java Beginners

please help me to solve this question about array
please help me to solve this question about array  write a program thatt stores vowels (a,e,i,o and u)in an array. Ask the user to enter any character. The program should ignore the case of that character (uppercase or lowercase 

Java Beginners

PLZ Need some help on the 2nd part of this question...Someone please help !!!!
PLZ Need some help on the 2nd part of this question...Someone please help !!!!  write an application that displays a menue of three items in a restaurant as follows: 1.Cheeseburger 4.99 2.Pepsi 2.00 3.Chips 0.75 prompt the user 

Java Beginners

Java Question Anyone need some HELP !!
Java Question Anyone need some HELP !!  Create a file that contains your favorite movie quote. Use a text editor such as Notepad and save the file as Quote.txt. Copy the file contents and paste them into a word-processing program 

Java Beginners

Programming (general)
Programming (general)  I haven't yet started college/university but I'm interested in studying programming. I wondering if programming is difficult... university. Thanks for the help 

Java Beginners

Plz help with third Question - Java Beginners
Plz help with third Question  1)- Specify and implement a procedure that determines whether or not a string is a palindrome. (A palindrome reads the same backward and forward; an example is "deed 

Java Beginners

Plz help me with this Question - Java Beginners
Plz help me with this Question  this is java code ------------------------- Consider the following code: int [ ] a = [1, 2, 3]; Object o ="123"; String t = "12"; String w = t + "3"; Boolean b = o.equals (a); Boolean b2 

Java Beginners

Programming Assignment
Programming Assignment  Hey there, We were given an assignment to write a program to read 10 student marks from the keyboard without using an Array... one student but i'm totally lost how to read 10 students. Help on this issue 

WebSevices Questions

programming questions
programming questions  this is my assignment questions please help me... the programs in c# language Describe the following with respect to creating Web Forms in .Net environment: a. Web Form Life Cycle b. Creating a Web Form 

Ajax-Tutorial

ajax programming
Ajax Programming What is Ajax Programming? Asynchronous JavaScript and XML... is based on the HTML, Java Script, CSS, and XML. Why Ajax Programming? When you.... Easy to learn and easy to write technology. Where to Start Ajax Programming 

Java Beginners

please any one can help me to write a code for this question?
please any one can help me to write a code for this question?  1) Copy one file content to other? 2) Count the number of words in a file 

Java Beginners

java programming
java programming  how to count the no. of constants in a user given string?? plzz help 

Java Beginners

Java Programming
Java Programming  Using Java Frame form, help me develop a GPA calculating device, able to show Grade and points together, and using MySQL database 

Java Beginners

Java Programming
Java Programming  Using Java Frame form, help me develop a GPA calculating device, able to show Grade and points together, and using MySQL database 

Java Beginners

please any one can help me to write a code for this question?
please any one can help me to write a code for this question?  Q 1) In a class first day 25 students are joined. After two days that total students will increased to 60. We can develop a program by using ArrayList concept 

Advertisements Advertisements
 

 

 

DMCA.com