Free Essay

Its 320

In:

Submitted By xaviermarsh123
Words 1186
Pages 5
HELPIDO.COM

-----------------------------------------------------------------------------------
FOLLOW THIS LINK TO GET THE TUTORIAL

http://helpido.com/java-its320-critical-thinking-assignment-2-java-program-2-of-6-70-points-custom-bankaccount-class-with-a-modified-constructor-1-enter-the-code/

-----------------------------------------------------------------------------------

Java – ITS320 – Critical Thinking Assignment #2

Critical Thinking Assignment #2:

Java Program #2 of 6 (70 Points)

Custom BankAccount Class with a Modified Constructor

1) Enter the code for the two classes “BankAccount.java” and “Program2.java” shown below. The Program2 class is a driver for the BankAccount class. Note that this version of the BankAccount class accepts a monthly interest rate in decimal format which must be calculated by the user.

/**

* BankAccount class

* This class simulates a bank account.

*

* (Taken from “Starting Out with Java - Early Objects

* (Third Edition) by Tony Gaddis, 2008 by Pearson Educ.)

*

*/

public class BankAccount

{

private double balance; // Account balance

private double interestRate; // Interest rate

private double interest; // Interest earned

/**

* The constructor initializes the balance

* and interestRate fields with the values

* passed to startBalance and intRate. The

* interest field is assigned to 0.0.

*/

public BankAccount(double startBalance, double intRate)

{

balance = startBalance; interestRate = intRate; interest = 0.0;

}

/**

* The deposit method adds the parameter

* amount to the balance field.

*/

public void deposit(double amount)

{

balance += amount;

}

/**

* The withdraw method subtracts the

* parameter amount from the balance

* field.

*/

public void withdraw(double amount)

{

balance -= amount;

}

/**

* The addInterest method adds the interest

* for the month to the balance field.

*/

public void addInterest()

{

interest = balance * interestRate; balance += interest;

}

/**

* The getBalance method returns the

* value in the balance field.

*/

public double getBalance()

{

return balance;

}

/**

* The getInterest method returns the

* value in the interest field.

*/

public double getInterest()

{

return interest;

}

}

/**

*

* Colorado State University – ITS-320 – Basic Programming

*

* This program demonstrates the BankAccount class.

*

* (Taken from “Starting Out with Java - Early Objects

* (Third Edition) by Tony Gaddis, 2008 by Pearson Educ.)

*

* Programmed by: Reggie Haseltine, instructor

*

* Date: June 19, 2010

*

*/

import java.util.Scanner; // Needed for the Scanner class import java.text.DecimalFormat; // Needed for 2 decimal place amounts public class Program2

{

public static void main(String[] args)

{

BankAccount account; // To reference a BankAccount object

double balance, // The account’s starting balance interestRate, // The annual interest rate pay, // The user’s pay cashNeeded; // The amount of cash to withdraw

// Create a Scanner object for keyboard input. Scanner keyboard = new Scanner(System.in);

// Create an object for dollars and cents

DecimalFormat formatter = new DecimalFormat (“#0.00″);

// Get the starting balance. System.out.print(“What is your account’s ” +

“starting balance? “); balance = keyboard.nextDouble();

// Get the monthly interest rate.

System.out.print(“What is your monthly interest rate? “); interestRate = keyboard.nextDouble();

// Create a BankAccount object.

account = new BankAccount(balance, interestRate);

// Get the amount of pay for the month. System.out.print(“How much were you paid this month? “); pay = keyboard.nextDouble();

// Deposit the user’s pay into the account. System.out.println(“We will deposit your pay ” +

“into your account.”); account.deposit(pay);

System.out.println(“Your current balance is $” + formatter.format( account.getBalance() ));

// Withdraw some cash from the account. System.out.print(“How much would you like ” +

“to withdraw? “); cashNeeded = keyboard.nextDouble(); account.withdraw(cashNeeded);

// Add the monthly interest to the account. account.addInterest();

// Display the interest earned and the balance. System.out.println(“This month you have earned $” +

formatter.format( account.getInterest() ) + ” in interest.”);

System.out.println(“Now your balance is $” + formatter.format( account.getBalance() ) );

}

}

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 timewith 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 shown and discussed in our text.

2) You may use the Windows Command Prompt command line interface or any Java IDE you choose to compile and execute your program.

3) You are to submit the following deliverables to the Dropbox:

a) A single Microsoft Word file containing a screen snapshot of your Java source code for both Program2.java and BankAccount.java (just the beginnings of the source code is OK) as it appears in your IDE (e.g. jGRASP, Net Beans, JDeveloper, etc.) or editor (e.g. a DOS “more” of the .java file’s first screen).

b) A listing of your entire modified version of the Java source code for Program2.java and BankAccount.java in the same Microsoft Word file as item a), and following item a). You can simply copy and paste the text from your IDE into Word. Be sure to maintain proper code alignment by using Courier font for this item. Do not submit the original source code files!

c) A screen snapshot showing all of your program’s inputs and output in the same Microsoft Word file, and following item b) above.

4) Your instructor may compile and run your program to verify that it compiles and executes properly.

5) You will be evaluated on (in order of importance):

a) Inclusion of all deliverables in Step #3 in a single Word file.

b) Correct execution of your program.This includes getting the correct results with the modified class files!

c) Adequate commenting of your code.

d) Good programming style (as shown and discussed in the textbook’s examples).

e) Neatness in packaging and labeling of your deliverables.

6) You must put all your screen snapshots and source code to a single Microsoft Word file.

HELPIDO.COM

-----------------------------------------------------------------------------------
FOLLOW THIS LINK TO GET THE TUTORIAL

http://helpido.com/java-its320-critical-thinking-assignment-2-java-program-2-of-6-70-points-custom-bankaccount-class-with-a-modified-constructor-1-enter-the-code/

-----------------------------------------------------------------------------------

Similar Documents

Premium Essay

Hcs/320

...elements in the communication process. 1.2 Analyze the five C’s of communication. 1.3 Identify two key elements that make individual communication successful. 1.4 Explain six roadblocks to successful communication in groups. 1.5 Discuss the impact of sexual orientation and age on communication. 1.6 Describe the cultural impact on one’s perception of health and its impact on communication. Readings Read the Week One Read Me First. Read Ch. 3, 5, & 10 of Communicating About Health. Read this week’s Electronic Reserve Readings. Participation Participate in class discussion. Ongoing Minimum of 4 days per week 1 Discussion Questions Respond to 2 weekly discussion questions. DQ 1: Thursday DQ 2: Saturday 1 Course Design Guide HCS/320 Version 2 2 Learning Team Instructions Create the Learning Team Charter. Begin developing the Communication Channels Paper due in Week Three. Thursday (Day 3) 2/23/2012 Individual Pre-class Survey Write your responses to the following questions based upon your experience. · What is communication? · What is the purpose of communication? · What is good communication? · What is your understanding of the differences between verbal and nonverbal communication? · What is your experience with team or group communication? · Describe your experience with utilizing formal written communication. Monday (Day 7) 2/20/2012 5 Week Two: Communication Channels in a Variety of Organizations Communication Differences in Large Versus...

Words: 1293 - Pages: 6

Premium Essay

Network 320

...Daniel Lombana NETWORK 320 Professor: Noel Broman Week 3 – Sip Trunking Write a 500-word paper that explains what a SIP trunk is, why you would use a SIP trunk, the equipment required for its use, and any RFCs that discuss SIP trunking. SIP Trunking or also known as SIP trunks is a communication service offered by different carriers and normally they are combined with Internet telephony service providers that allows businesses u organizations to use voice over the Internet protocol (VoIP) while you are connected to the Internet. The main purpose of using Sip Trunking is to extend VoIP or IP telephony use beyond the enterprise network and reduced cost. Also, we can create and control the communications sessions that are the basis of VoIP telephony. In few words your organization would be able to use instant messaging, multimedia, conferencing, and other real-time services that can traverse a SIP trunk. Vantages: * Enables you to extend VoIP telephony beyond your organization’s firewall * SIP trunks can carry instant messages * With Sip Trunks you can do multimedia conferences * User presence information. * Real-time communications services. * Easier to configure and less expensive to design, operate, maintain, and upgrade. * Save money on long distance service. Long distance service typically costs significantly less with a SIP trunk connection. Substantial cost savings from reduced complexity, maintenance, and administration. * Eliminate...

Words: 595 - Pages: 3

Premium Essay

Phl 320

...PHL/320 University of Phoenix Robert Sparks June 4, 2015 Critical thinking- The art of exploring questions that focuses on how we think- not what we think; which guides us to improving the way we think. Simply put it is the process of improving the way we think while using certain skills such as having the ability to analyze the information we receive to be able to process, assess and become a critical thinker. One must possess the ability to reason, thus critical thinking allows one to make sound, rational decisions based on the information received as a result of asking probing questions and actively listening for the answers. This way of thinking will offer one more control of their decisions; allowing them to learn by simply inquiring. I have had many debates with close friends about my way of thinking. I was once that person who knew what she knew and would conclude based upon my own knowledge and understanding of how I thought things or situations were supposed to conclude and how one will need to proceed. This way of thinking usually came to life without fact and an overflow of baseless assumptions. Yes, I know this was an awful way of thinking but I am being honest. I was that person who would not ask questions for understanding. I was stubborn and refused any guidance or teaching on the topic. Then I met my match. I found myself toe-to-toe in the ring with as accomplished thinker. My friend helped me to think outside of my box and to cut ties with my over-imaginative...

Words: 301 - Pages: 2

Premium Essay

Mkt 320

...Katheryn Mason MKT 320-020 October 27, 2015 The Diffusion on Izon Wi-Fi Video Monitor Relative Advantage This product beats its competitors because it has a relative advantage. It is a much better product than old security systems because it is more up to updated with today’s standards and is easy to use. It provides a camera inside and outside of your house that you can access anytime, anywhere. You are able to control Regular security systems; you can only set them and disarm them. The Izon provides different features, like being able to control electrical things around your house when your not home. People would feel safer with this product and would be more willing to purchase it because of all the great features it offers compared to old security systems. Compatibility The compatibility of this product is perfect for people today all over the world and is unbelievable. So many people are concerned about their own safety along with the safety of their families. This product makes that part of life easy for people because they can monitor their home whenever they feel the need. I think it would and is very successful in today world because it’s a new technology that people are interested in. Everyone who owns a home and has a family will do whatever they can to protect them and this product is the perfect product for that need! It is also extremely inexpensive so more people are willing to test it out. This product would be great for early adopters because once many...

Words: 790 - Pages: 4

Free Essay

Mus 320

...Get Me In, Part 4: Create a Plan to Monetize a Song V J L Mus 320 February 18, 2016 Get Me In, Part 4: Create a Plan to Monetize a Song In week 3 we were asked to create a publicity, marketing, and promotional strategy designed to introduce the specific artist we focused on. My artist was Adele; Adele is a well-known music artist and songwriter. The purpose of week 4’s paper is to create a sales and distribution plan that will help Adele generate more income. When it comes to describing Adele and a specific brand it can be rather complicated in a sense that she (Adele) has made it clear and in fact “The word may be everywhere now, but Adele doesn't want to be called a "brand." “I don’t like that word,” the record-breaking singer said of "brand" in a new interview for the cover of Time magazine. “It makes me sound like a fabric softener, or a packet of crisps. I’m not that" ("Business Insider ", 2015). She went on to say that “She believes that artists should strive to be deeper than a "brand and more like a package for their fans” ("Business Insider ", 2015). With that being said and honoring the wishes of my artist I will begin to explain how Adele has been able to remain on top without being “branded” per say. She sticks to her roots and what she is comfortable with whether it is her style, her drive, her music, and her sound and as uncommon as that is for an artist today she has managed to outsell and outshine almost every artist to date. Maybe it is the stance...

Words: 981 - Pages: 4

Premium Essay

Pscy 320

...PSCY 320 Tim and Maria have been married for 12 years; they have 2 children, Nicole (7) and Natalie (4). Tim works as a fireman, while Maria is a stay at home mom. Since Tim works two days a week in 48 hour increments, he felt that he had the time to start a landscaping business to bring in extra money so Maria could stay home. He works at his landscaping business around his schedule at the firehouse. Maria, on the other hand, does the bookkeeping for the landscaping company. Before having children, Maria worked fulltime and made good money, she was confident in her life choices, and seemed to be happy with all of her accomplishments. Once the decision was made to start a family, Tim and Maria thought the best option was for Maria to quit her job and stay at home with the children. Not long after the second child was born, Maria fell into a depressed state. She felt that she was not pulling her weight around the house financially, she had gained weight, and she thought she was losing the attention of her husband. Tim is never home to help with the girls and when he is home, he is busy arranging his next days schedule. He works at least six days a week and sometimes seven. He does not mind the amount of work that he puts in because he knows that his family is well taken care of financially and physically. Their daughters know that Daddy works very hard to buy the things they have, and Mommy will make sure that their needs are met. Tim is at a point in his life where he...

Words: 1279 - Pages: 6

Premium Essay

Bis 320

...Applying Information Security and SDLC to Business Team Names Here BIS/320 Date Applying Information Security and SDLC to Business Amazon.com - Bookstore Amazon.com is known as one of the largest retail online stores in the world. Of course this online retail store was not always the largest and had a shaky slow start because the online layout was not eye-catching. In 1994, Jeff Bezos, who founded Amazon.com started his business in his garage in Washington State selling books. However, in 1994, Nick Hanauer took an interest in Bezos business and invested $40,000, and in 1995 Tom Alburg invested $100,000 to join this venture. After receiving these investments Bezos decided to create a website that would be more appealing to customers and hoped to get his business to take off. Over the next three years Amazon increase in book sales, which amazed Bezos because after an analysis was completed he was shocked to find out outside of local customers who were purchasing books from Amazons but customers around the world. In 1997, Amazon reached revenue in the amount of $15.7 million. By 1998, Amazon was starting to show signs of success when Bezos started listing new products for the customers could purchase online (Amazon.com Mission Statement, 2012). Vision and Mission - The mission statement for Amazon.com success is centered on their customers and without their customers Amazon would not exist. Although customers...

Words: 3158 - Pages: 13

Premium Essay

Hcs/320

...(Individual) Communication and Crisis Paper Yahaira Jorge HCS/320 January 13, 2014 Ms. Tricia Tran Communication and Crisis  My name is Yahaira Jorge and I am the director of the regional Emergency Management Office. We have begun to receive official reports of contaminated water with a life-threatening biological agent. As director, I have many priorities in getting this situation under control, but most importantly will need to be in communication with all the organizations involved. Putting our crisis plan into immediate effect will hopefully keep everything organized. The ultimate goal will be to get the information out to the public with a plan, swiftly but making sure not to create panic along the way. Also making sure to get the support from our fire departments and police officers to participate in giving bottles of water to our people not to get sick and ill from this contaminated water. A quick response is very important in a crisis situation. In order to have a quick response, a crisis plan is necessary. A crisis plan will vary from institution to institution, but most will follow similar guidelines. First and foremost, notifications of the situation or event to communications lead, or second in command. This is important because if there is a delay in getting the information to a higher person in command, that could create a bigger mess than needed. Secondly, notify the institution leaders and staff, and ancillary management. Making sure the appropriate...

Words: 375 - Pages: 2

Premium Essay

Hrm-320-

...1. Define BFOQ and list to which characteristics it applies. Bona Fide Occupational Qualification (BFOQ) is a defense that acknowledged discrimination. It allows an employer discriminate for reasons of religion, sex, national origin, age, when this factors can affect the normal operations of a particular business. (Cornell University Law School, 2010) To be able to use BFOQ , the employer needs to prove that the job requires certain type of worker for the success and safety of the business. They need to demonstrate that is necessary to have a specific type of worker with specific characteristic to be able to perform the job in an effective matter. For example Churches have the right to use BFOQ to hire only people with their religion denomination to be able to work there because their believe can affect the way the Church operates. 2. What is the purpose of the Glass Ceiling Commission? Glass Ceiling is the term given to the invisible barriers that prevent women and minority advance or move to a management position in a company (Glass Ceiling Commission-National Archives and Records, 1995). The Civil Rights Act of 1991 created The Glass Ceiling Commission to address the barriers by of studying the manners in which business fills management and decision making positions, the developmental and skill-enhancing practices used to foster the necessary qualification for advancement into such positions, and the compensation programs and reward structures currently utilized...

Words: 1020 - Pages: 5

Free Essay

Sec 320

...Perimeter Security Applications Robinson Paulino DeVry College of New York Sec- 330 Professor: Gerard Beatty Perimeter Security Applications Outline Introduction 2 Intruder Detection Accuracy 3 Security Cameras 4 1. Using Size Filters for Video Analytics Accuracy 4 2. Geo-Registration and Perimeter Security Detection Accuracy 5 3. Clarity against a moving background 5 Perimeter Security Best Practices 6 Auto Tracking PTZ Camera 6 Long Range Thermal Camera 6 Covering Perimeter Camera Blind Spots 7 Determine a Perimeter Camera’s Range 7 Perimeter Fence . 8 Chain-Link Fences Protection 8 Electric and Infrared Fences 8 Fiber Optic Intrusion Detection Systems 9 In-Ground Intrusion Detection Systems 10 References 11 Perimeter Security Applications Introduction Physical security is the protection offered for property, these may be buildings or any other form of asset, against intruders (Arata, 2006). . The idea therefore, is to keep off unwanted persons or objects from ones premises. One’s premise is defined by a boundary which separates private property from the rest of the land. This boundary is referred to as the perimeter. The perimeter could be physical or logical. Physical security is intended to keep intruders from land and grounds around such property. Logical perimeters on the other hand, are for protection against computer sabotage or any other remote malicious activities (Fennelly, 2012). In a nutshell, perimeter security...

Words: 2429 - Pages: 10

Premium Essay

Accting 320

...We have made substantial progress in the past two years in building a stronger foundation for our company and improving our business model. Our survival is no longer in question. Our net debt of slightly over $23 million (down from $52 million two years ago) is manageable, and we are continuing to look for ways to further strengthen our balance sheet. Our cash flow is healthy, and we have budgeted in excess of $13 million in fiscal 2011 for capital expenditures, much of which will be devoted to store renovation and construction of new stores. We generated positive company same store sales in all four quarters of fiscal 2010 and, despite the difficult economy, we delivered substantially higher operating income. We essentially broke even in fiscal 2010, compared to a net loss of $67.1 million in fiscal 2008 and $4.1 million in fiscal 2009. We ended fiscal 2010 with 582 Krispy Kreme stores across the U.S. and 18 other countries, up from 449 stores 2 years ago. By shifting to the small shop focus and increasing the number of Krispy Kreme retail shops in high traffic areas, we are making ourselves more convenient for our customers, which should enable us to increase on-premises sales of doughnuts and complementary products. We also are trial testing new products to create broader appeal, addressing both seasonal and day part issues. In our off-premises grocery and convenience store channels, we are re-energizing the business by introducing and marketing new longer shelf-life...

Words: 278 - Pages: 2

Premium Essay

Hcs 320

...What is communication? There are many different meanings for communication. There would be an act or the process of the communicating, also with a fact being within communicated. Communication also would be your opinions, your thoughts, and some information translated through signs, also speech and even writing. Some views, the news, and any important documents could be also a way of communication. What is the purpose of communication? The purpose of communication would to help many groups and many people to connect with each other and to also understand one another as well. Communication can mean the information would be disseminated. Another purpose of communication would be the thoughts and the transduction of all of the emotions from each other. What is good communication? Good communication would be when you can communicate with one another, and get along. Also good communication would be when the message you have sent is clearly delivered and you can understand the message that was sent. With good communication will always come with some type of great success. Also most people would have to agree that most of the experts say that good communication would be understood better. What is your understanding of the differences between verbal and nonverbal communication? My understanding of the differences between verbal and nonverbal communication would be; verbal communication would be the volume used, the rate used, and the pronunciation and the articulation...

Words: 466 - Pages: 2

Premium Essay

Res 320

...What is the difference between information and data? How are they defined? Is one better than another when it comes to research? Provide examples of each.  When I first read this message the first thought I had in mind were both can be the same or can be different depending on how you look at them. I can argue that both are the same because data is information and information consists of data. Then I look closer and give it some thoughts then there is a little difference between data and information. According to www.diffen.com Data is raw and can be unorganized facts and may unprocessed. Data can be something simple and random and it is almost useless if it is not organized. Data can be in many forms and method. An example of data is the student’s test scores, the NBA scores, the NFL scores…etc. On the other hand information can be defined as data being processed, organized, structure. One example of information is the class’ average score. The statistics of all the best running back players of the NFL are good information. In brief; data must be processed in a context in order to give it meaning. Without the processed of data, data is just a raw bucket of information. Information is processed data organized in a way that can be useful depending on the nature of the work place/situation. I am working for a healthcare system and we collect many different types of data and put together many different pieces of information. We organized these data into many categories...

Words: 282 - Pages: 2

Premium Essay

Law 320

...Wk6 2. CORPORATIONS ACT 2001 - SECT 249U Chairing meetings of members (replaceable rule--see section 135) (1) The directors may elect an individual to chair meetings of the company's members. (2) The directors at a meeting of the company's members must elect an individual present to chair the meeting (or part of it) if an individual has not already been elected by the directors to chair it or, having been elected, is not available to chair it, or declines to act, for the meeting (or part of the meeting). (3) The members at a meeting of the company's members must elect a member present to chair the meeting (or part of it) if: (a) a chair has not previously been elected by the directors to chair the meeting; or (b) a previously elected chair is not available, or declines to act, for the meeting (or part of the meeting). (4) The chair must adjourn a meeting of the company's members if the members present with a majority of votes at the meeting agree or direct that the chair must do so. 3. After reading that, only (3) is possible -- the 80 old man. Because Sect 201B -- Only a real person can be a director ( a) Mr Shift himself doesn't want to be a director. Mr Shift wants his own family company to be the director, which is contradict to Sect 201B. A family company is not a real person. ( b) Ms. Avid has still 5 months to serve the conviction. Sect201B disqualifies her to be a director unless Ms. Avid is granted permission by the ways stated in Part...

Words: 298 - Pages: 2

Premium Essay

Hcs 320

...Pre Class Survey What is communication? Communication is to share information between two or more people and can be processed in different ways. Verbal communication is spoken face to face, on a telephone, or radio and television. Non verbal communication is body language how we look, how we present ourselves, and even how we smell. Then there is written communication which is emails, letters, books, magazines, newspapers, and even the internet. What is the purpose of communication? The purpose of communication is to communicate your message directly to the receiver. Communication bonds individuals with common goals or outlooks to strengthen a bond. Communication allows individuals and or a group of individuals to better understand one another and connect. Communication is also the way in which information is received. It is also the way that emotions and thoughts are received from one another. The purpose is to mainly create peace and harmony between the sender and the receiver. What is good communication? Good communication is a way to make certain that the information received is the way that the sender intended it to be taken or perceived. The goals of good communication is to create a common outlook, hopefully changing behaviors, and gathering information. Good communication is also based on being a good listener which requires eye contact and taking in the information given by the sender. Being a good listener comes into play especially...

Words: 619 - Pages: 3