Bankaccount.Java and Program 2.Java

In: Computers and Technology

Submitted By spystar
Words 1152
Pages 5
Question

Compile the two test files (BankAccount.java first and then Program2.java second). Execute
Program2 with the following inputs: starting balance - $500 (don't enter the dollar sign) monthly interest rate - 0.00125 (this is a 1.5% annual rate) monthly pay - $1000 (don't enter the dollar sign) withdrawal amount - $900 (don't enter the dollar sign)
Verify that you earn $0.75 in interest and have an ending balance at the end of the month of
$600.75.
Then modify the BankAccount class's constructor method to create a BankAccount object which stores a monthly interest when the user inputs an annual interest rate of the format "nnn.nn" (i.e.
1.5). Note that the BankAccount constructor stored a monthly interest rate for the BankAccount object's instance field originally, but the user had to convert the annual rate to a monthly rate (i.e.
1.5 to 0.00125). Then modify the Program2 driver class to prompt the user for an annual interest rate. Recompile both classes and execute the modified Program2 driver class again, this time with following inputs: starting balance - $500 (don't enter the dollar sign) annual interest rate - 1.5 monthly pay - $1000 (don't enter the dollar sign) withdrawal amount - $900 (don't enter the dollar sign)
Verify that you still earn $0.75 in interest and still have an ending balance at the end of the month of $600.75 as you did with the original code.
Submit only the modified source code files, final user inputs, and final output. Do not submit the original source code, inputs, and output.
Be sure that you include the course, the program number, your name, and the date in your program header. Also include this information at the top of your Microsoft Word file. Include additional comments as necessary and maintain consistent indentation for good programming style as…...

Similar Documents

Hello World Java Program

...Description of Code: This code will generate a pop up box that will include the text “Hello, World!” and will also include a JButton that says “Exit”. On mouse clicking the JButton, the box will terminate from the screen. Pseudocode: Import Java API's Create public class HelloWorld Create main function (String[] args) new JFrame frame "Week 1 Assignment" frame Set default close operation new JLabel label "Hello World" label set preferred size 325,100 label set to CENTER add label to frame pack frame new JPanel panel add frame to panel new JButton button “Exit” set label alignment to CENTER set button alignment to CENTER set Layout to BoxLayout set frame to visible set frame visible set frame size 350,200 add ActionListener to button public void actionPerformed System.exit (0) – Close program upon clicking Exit button Actual Code portion of paper: import javax.swing.*; import java.awt.Component; import java.awt.event.*; import javax.swing.JFrame; public class HelloWorld { public static void main(String[] args) { JFrame frame = new JFrame("Week 1 Assignment"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel label = new JLabel("Hello, World!"); JPanel panel = new JPanel (); JButton button = new......

Words: 251 - Pages: 2

Java

......................................1 Chart: Highlights ......................................................................................................................1 1.1 Objectives ...................................................................................................................................1 1.2 Keys to Success ........................................................................................................................2 1.3 Mission........................................................................................................................................2 2.0 Company Summary.............................................................................................................................2 2.1 Company Ownership .................................................................................................................2 2.2 Start-up Summary ......................................................................................................................2 Table: Start-up .........................................................................................................................4 Table: Start-up Funding ..........................................................................................................5 Chart: Start-up .........................................................................................................................6 2.3 Company Locations and Facilities ..................

Words: 7859 - Pages: 32

Java

...we're continuing our Java security research series by analyzing other plug-ins, browser extensions and rich internet applications that are commonly exploited. Our previous research indicated that the current state of Java affairs isn't pretty. At that time, ninety-three percent of enterprises were vulnerable to known Java exploits. Nearly 50 percent of enterprise traffic used a Java version that was more than two years out of date. Through Websense ThreatSeeker Intelligence Cloud analysis we now discover: Only 19 percent of enterprise Windows-based computers ran the latest version of Java (7u25) between August 1-29, 2013. More than 40 percent of enterprise Java requests are from browsers still using outdated Java 6. As a result, more than 80 percent of Java requests are susceptible to two popular new Java exploits: CVE-2013-2473 and CVE-2013-2463. 83.86 percent of enterprise browsers have Java enabled. Nearly 40 percent of users are not running the most up-to-date versions of Flash. In fact, nearly 25 percent of Flash installations are more than six months old, close to 20 percent are outdated by a year and nearly 11 percent are two years old. Our in-depth analysis ran for one month, across multiple verticals and industries. We surveyed millions of real-world web requests for Java usage through our global Websense ThreatSeeker Intelligence Cloud. New Java Exploits and the Neutrino Exploit Kit New Java exploits......

Words: 1745 - Pages: 7

Prg 420 Prg420 Prg/420 Java Programming I - Week 2

...TUTORIAL http://helpido.com/prg-420-week-2/ ---------------------------------------------------------------- PRG 420 PRG420 PRG/420 Java Programming I - Week 2 ________________________________________ Java™ and Object-Oriented Programming Fundamentals Discussion Question : Three Types of Errors What are the three types of errors that you can encounter in a Java™ program? Describe them, and explain how you would minimize the errors. What are some examples of errors that you have seen before? Discussion Question : Blueprint for an Object A class is a blueprint for an object. A class may have a default constructor, a constructor with arguments, accessor methods, mutator methods, public fields, and private fields. Choose a category (such as animal, vehicle, and so on) and describe how you would design a class for it. Individual Simple Commission Calculation Program Part 1 Write a Java™ application using NetBeans™ Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors: • A salesperson will earn a fixed salary of $50,000 • A salesperson will also receive a commission as a sales incentive. Commission is a percentage of the salesperson’s annual sales. The current commission is 5 % of total sales. • The total annual compensation is the fixed salary plus the commission earned. The Java™ application should meet these......

Words: 282 - Pages: 2

Prg 420 Prg420 Prg/420 Java Programming I - Week 2

...TUTORIAL http://helpido.com/prg-420-week-2/ ---------------------------------------------------------------- PRG 420 PRG420 PRG/420 Java Programming I - Week 2 ________________________________________ Java™ and Object-Oriented Programming Fundamentals Discussion Question : Three Types of Errors What are the three types of errors that you can encounter in a Java™ program? Describe them, and explain how you would minimize the errors. What are some examples of errors that you have seen before? Discussion Question : Blueprint for an Object A class is a blueprint for an object. A class may have a default constructor, a constructor with arguments, accessor methods, mutator methods, public fields, and private fields. Choose a category (such as animal, vehicle, and so on) and describe how you would design a class for it. Individual Simple Commission Calculation Program Part 1 Write a Java™ application using NetBeans™ Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors: • A salesperson will earn a fixed salary of $50,000 • A salesperson will also receive a commission as a sales incentive. Commission is a percentage of the salesperson’s annual sales. The current commission is 5 % of total sales. • The total annual compensation is the fixed salary plus the commission earned. The Java™ application should meet these......

Words: 282 - Pages: 2

Java

...JAVA: Cost cutting may not be the long-term EPS driver Sun Microsystems, Inc. (JAVA) continues with its resurrection of earnings by treading into positive turf and achieving an operating profit in FY07, the first time since FY01. JAVA recorded three consecutive quarters of positive EPS in FY07 and is now targeting an operating margin of at least 10% in FY09. However, underlying this growth is a scenario that bristles with complexities, and not everything is as rosy as it seems. For instance, growth appears anemic—sales are expected to rise in low single digits this quarter. And it’s not yet clear whether JAVA is making new money through open source or simply finding new ways to save money. All eyes are now on Jonathan I. Schwartz, who took over as CEO of JAVA from Scott McNealy in Apr-06; justifiably so, because Schwartz is not merely seeking to turn around operations by paring payrolls, reducing headcount, and restructuring. He has set out to redefine the way a company can do business in the new Web age. If Schwartz can reestablish Java as a credible trendsetter, it would make for one of the Valley’s more spectacular comebacks. We analyze whether Schwartz’s pronouncements of growth objectives match JAVA’s performance across sectors and whether the targets can be achieved by cost containment rather than revenue growth. We set out to gauge whether this turnaround is a temporary blip or a true resurgence. Management change and new objectives When Schwartz took over...

Words: 1427 - Pages: 6

Calculator Java Program

...Calculator Program: import java.awt.*; import javax.swing.*; public class Calculator extends JFrame { JTextField display;// Display text field. JPanel buttonPanel;// Panel for buttons. JButton buttons[];// Array to create button objects. Calculator() { super("Calculator");// Gives the frame the title of Calculator. display = new JTextField();// Creates and stores the object of the text // field in the display. buttons = new JButton[16];// Array made up of 16 variables to signify // buttons. buttons[0] = new JButton("7");// Seven button. buttons[1] = new JButton("8");// Eight button. buttons[2] = new JButton("9");// Nine button. buttons[3] = new JButton("/");// Divide button. buttons[4] = new JButton("4");// Four button. buttons[5] = new JButton("5");// Five button. buttons[6] = new JButton("6");// Six button. buttons[7] = new JButton("*");// Multiply button. buttons[8] = new JButton("1");// One button. buttons[9] = new JButton("2");// Two button. buttons[10] = new JButton("3");// Three button. buttons[11] = new JButton("-");// Subtract button. buttons[12] = new JButton("0");// Zero button. buttons[13] = new JButton(".");// Dot button. buttons[14] = new JButton("=");// Equals button. buttons[15] = new JButton("+");// Add button. buttonPanel = new JPanel();// Creates panel for buttons. buttonPanel.setLayout(new GridLayout(4, 4, 5, 5));// Sets the layout of //......

Words: 917 - Pages: 4

Java

...Eclipse and Java for Total Beginners Tutorial Companion Document Eclipse And Java For Total Beginners Companion Tutorial Document By Mark Dexter Table of Contents Introduction........................................................................................................... .............................2 . Tutorial Target Audience.....................................................................................................................2 Tutorial Objectives..............................................................................................................................2 Why learn Java with Eclipse?.............................................................................................................3 Topics Covered...................................................................................................................................3 Tutorial Approach............................................................................................................... ................3 . Getting The Most From This Tutorial..................................................................................................3 Sample Java Application – Personal Lending Library........................................................................4 Downloading and Installing Eclipse ...................................................................................................4 Playing the Lessons...........................

Words: 7556 - Pages: 31

Java

...Object Oriented System Software Engineering with JAVA Coursework The coursework is 50% of the assessment for the module. Learning Outcomes Have a through knowledge of one object orientated method down to detailed design. Have the experience to implement an object oriented design in an object oriented language. Assessment Criteria IMPORTANT: This is an individual assignment, all submitted components must be your own work or appropriately accredited. The assignment is scenario based (see attached scenario). You are encouraged to make any assumptions you deem necessary when analyzing he requirements outlined in the scenario, however, these must be clearly stated in the report. Your report should address the following three tasks: Task 1: Design the system required using the UML method. Task 2: Implement the system (or part of , see Grading below) using JAVA. Task 3: Objectively evaluate your solution including an appraisal of the suitability of UML and JAVA as tools for implementing object oriented solutions. Deliverable • You should submit a hard-copy and an electronic copy of the assignment • The submission should not be longer that 40 pages including diagrams but excluding the Appendices. • Instructions on how to install and run the program should be provided in an Appendix. Grading Distinction-Grade A (70%) To achieve a Distinction, you must successfully meet all of the criteria for a Merit and Task 1 • The design is comprehensive......

Words: 1035 - Pages: 5

Java

...A Comparison between Java and .Net Languages Introduction Java and .Net provide technologies that enable skilled developers to build quality enterprise applications. These technologies are rarely picked based on performance alone. There are many factors to consider when choosing Java or .Net. These considerations are often the deciding factor when choosing one or both of these platforms. Java Java is kenned as both a programming language and a development platform. It was first developed by Sun Microsystems in 1991 and subsequently relinquished in 1995. To help to make the language more accepted and accessible, Sun Microsystems developed it as an object oriented language with a syntax that is very similar to C++. (Java vs. .NET, 2007) Sun Microsystems decided to create this new platform out of a desire to be able to write programs only once that could be run on any system. (James) The Java 2 platform was launched in December 1998. This was a major amelioration of the platform, and included incipient graphics, user interface, and enterprise capabilities. This upgrade was over seven times as large as the initial Java 1.0 release and marked the maturity of the Java platform. (What is java?) Within the Java 2 platform there are 3 editions: • The Java 2 Standard Edition (J2SE) Provides the essential compiler, tools, runtimes, and APIs for writing, deploying, and running applets and applications. • The Java 2 Enterprise Edition (J2EE) Defines a standard for developing......

Words: 2279 - Pages: 10

Ece 312 Week 2 Program and Curriculum Planning

...ECE 312 WEEK 2 PROGRAM AND CURRICULUM PLANNING To purchase this visit here: http://www.activitymode.com/product/ece-312-week-2-program-and-curriculum-planning/ Contact us at: SUPPORT@ACTIVITYMODE.COM ECE 312 WEEK 2 PROGRAM AND CURRICULUM PLANNING Program and Curriculum Planning. The word program in early childhood education refers to “the planning of the curriculum, which also includes the instructional practices, the daily schedule, the routines for caring for children, and the recreational activities, such as outdoor play” (Gadikowski, 2013, section 4.1). Educational administrators are the instructional leaders of their schools and centers primarily in the planning of curriculum. For this assignment, you will choose a particular age group (infants, toddlers, or preschoolers) and design (outline) a program that is developmentally appropriate. Please review the following website for an example: Primrose School at East Lake In your paper: 1. Explain how the role of the administrator in program and curriculum planning is different from that of theteacher. 2. Briefly describe the learning and developmental needs of your chosen age group. 3. Analyze how your program will address the cognitive, social, emotional, and physical development ofchildren in this age group (give specific curricular ideas for each area of development) as well asclassroom management and the daily schedule. 4. Explain how your program aligns with the philosophy, vision, and mission......

Words: 1345 - Pages: 6

Java

...Software Design Introduction to the Java Programming Language Material drawn from [JDK99,Sun96,Mitchell99,Mancoridis00] Software Design (Java Tutorial) © SERG Java Features • “Write Once, Run Anywhere.” • Portability is possible because of Java virtual machine technology: – Interpreted – JIT Compilers • Similar to C++, but “cleaner”: – No pointers, typedef, preprocessor, structs, unions, multiple inheritance, goto, operator overloading, automatic coercions, free. Software Design (Java Tutorial) © SERG Java Subset for this Course • We will focus on a subset of the language that will allow us to develop a distributed application using CORBA. • Input and output will be character (terminal) based. • For detailed treatment of Java visit: – http://java.sun.com/docs/books/tutorial/index.html Software Design (Java Tutorial) © SERG Java Virtual Machine • Java programs run on a Java Virtual Machine. • Features: – – – – – Security Portability Superior dynamic resource management Resource location transparency Automatic garbage collection Software Design (Java Tutorial) © SERG The Java Environment Java Source File (*.java) Java Compiler (javac) Java Bytecode File (*.class) Java Virtual Machine (java) Software Design (Java Tutorial) © SERG Program Organization Source Files (.java) Running Application Running Applet JAVA BYTECODE COMPILER Class Files (.class) JAVA VIRTUAL MACHINE WEB BROWSER Software Design (Java Tutorial) © SERG Program Organization Standards •......

Words: 5230 - Pages: 21

Pantawid Pamilyang Pilipino Program 2

...Abstract When the Pantawid Pamilyang Pilipino Program was designed, the government publicly promised to limit to five years the giving of the education and health grants. This five-year limit is almost over for the first set of beneficiaries by 2013. The natural policy question then is: Would it be wise to keep the promise or would an extension be better? This paper presents five arguments and evidence why the extension of the program is better than keeping the promise to limit it to five years. The five arguments include: (a) the problems that the Pantawid had been designed to address continue to be high priority issues; (b) Pantawid remains credible as an effective and valuable instrument for poverty alleviation in the short run and for reducing the transmission of intergenerational poverty in the long run; (c) the extension could provide great opportunities to produce a much greater positive impact on the welfare of the poor; (d) the extension could buy much-needed time for developing and implementing an adequate and workable transition promotion strategy to help beneficiaries outgrow their need for CCT assistance and, therefore, facilitate its termination; and (e) secondary education enrollment and completion produces high returns in terms of increased earning and is achievable with a moderate amount of subsidy. The paper ends with cautionary notes including articulating that Pantawid remains a bridging program; the need for a careful study to ensure affordability and......

Words: 724 - Pages: 3

Java

...Release Team[oR] 2001 [x] java Java 2: The Complete Reference by Patrick Naughton and Herbert Schildt Osborne/McGraw-Hill © 1999, 1108 pages ISBN: 0072119764 This thorough reference reads like a helpful friend. Includes servlets, Swing, and more. Table of Contents Back Cover Synopsis by Rebecca Rohan Java 2: The Complete Reference blends the expertise found in Java 1: The Complete Reference with Java 2 topics such as "servlets" and "Swing." As before, there's help with Java Beans and migrating from C++ to Java. A special chapter gives networking basics and breaks out networking-related classes. This book helps you master techniques by doing as well as reading. Projects include a multi-player word game with attention paid to network security. The book is updated where appropriate throughout, and the rhythm of text, code, tables, and illustrations is superb. It's a valuable resource for the developer who is elbow-deep in demanding projects. Table of Contents Java 2 Preface - 7 Part l The Java Language - The Complete Reference - 4 Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 hapter 10 - The Genesis of Java - 9 - An Overview of Java - 20 - Data Types, Variables, and Arrays - 36 - Operators - 57 - Control Statements - 75 - Introducing Classes - 94 - A Closer Look at Methods and Classes - 111 - Inheritance - 134 - Packages and Interfaces - 156 - Exception Handling - 174 Chapter 11 - Multithreaded......

Words: 78285 - Pages: 314

Java

...JMaster list of Java interview questions - 115 questions By admin | July 18, 2005 115 questions total, not for the weak. Covers everything from basics to JDBC connectivity, AWT and JSP. 1. What is the difference between procedural and object-oriented programs?- a) In procedural program, programming logic follows certain procedures and the instructions are executed one after another. In OOP program, unit of program is object, which is nothing but combination of data and code. b) In procedural program, data is exposed to the whole program whereas in OOPs program, it is accessible with in the object and which in turn assures the security of the code. 2. What are Encapsulation, Inheritance and Polymorphism?- Encapsulation is the mechanism that binds together code and data it manipulates and keeps both safe from outside interference and misuse. Inheritance is the process by which one object acquires the properties of another object. Polymorphism is the feature that allows one interface to be used for general class actions. 3. What is the difference between Assignment and Initialization?- Assignment can be done as many times as desired whereas initialization can be done only once. 4. What is OOPs?- Object oriented programming organizes a program around its data, i. e. , objects and a set of well defined interfaces to that data. An object-oriented program can be characterized as data controlling 5. access to code. What are Class,......

Words: 6762 - Pages: 28

GostFilm3 | FIFA 16 Soccer | Animal Crackers (2018)