...SD2720 Module 3 Working with Methods Click Link Below To Buy: http://hwcampus.com/shop/sd2720-module-3-working-with-methods/ SD2720 Module 3 Working with Methods and Encapsulation Lab 3.1 Creating a Method In this lab, you will complete two tasks related to Java methods. The tasks performed in this lab will help you use method overloading and understand ambiguous overloading. Task 1 Write a program for swapping two numbers. In the program: • Create a method by passing primitive values as parameters for checking the result. • Create another method by passing object references as parameters for checking the result. • Identify the difference between two outputs. Task 2 Write a Java program that accepts 10 numbers from the user and finds the greatest and smallest numbers among them. Create two methods, findGreatest() and findSmallest(), to find the greatest and smallest numbers, respectively. Task 3 Write a Java program that implements the following methods: • getNumbers()to accept two numbers from the user. • calculateHCD()to calculate the highest common divisor (HCD) of the two numbers. Please note that it should be a recursive function. • calculateLCM()to calculate the least common multiple (LCM) of the two numbers. Display()to display HCD and LCM. Submission Requirements: Compress your Java project folder and responses in a Microsoft Word document into one zipped folder and submit it to the instructor. Evaluation Criteria:...
Words: 384 - Pages: 2
...procedures have been developed to id the facilities l t aid th f iliti planner i d i i l in designing layouts. t Construction type Improvement type 4-4 Apples plant layout procedure • • • • • • • • • • Procure th b si d t P the basic data Analyze the basic data Design the productive process Plan the material flow pattern Consider the handling l h dli plan general material • • • • • • • • • • Determine storage requirements Plan service activities and auxiliary Determine space requirements Allocate activities to total space Consider building type Construct master layout Evaluate, adjust, and check the , j , layout with appropriate persons Obtain approvals Install the layout Follow up on implementation of the layout. 4-5 Calculate equipment requirement Plan...
Words: 2488 - Pages: 10
.... MC 1. (TCO 13) Text files are what type of file? 4 Points : Sequential Random access Binary Consecutive Instructor Explanation: Lecture / Chapter 13 Edit 3. MC 1. Delete (TCO 13) To create an input file object, what kind of type would you use? 4 Points : ifstream ofstream fstream instream Instructor Explanation: Lecture / Chapter 13.1 Introduction Edit 4. MC 1. Delete (TCO 13) To create an output file object, what kind of type would you use? 4 Points : ifstream ofstream fstream instream Instructor Explanation: Lecture / Chapter 13.1 Introduction Edit 5. MC 1. Delete (TCO 13) The header file that defines the classes for processing and manipulating files is called the _____. 4 Points : Instructor Explanation: Chapter 13.1 Introduction Edit 6. 7. 8. MC 2. Delete (TCO 13) What do the following statements accomplish? ifstream theFile; theFile.open( myFile.txt , ios::in); 4 Points : Opens myFile in read mode Opens myFile in append mode Creates an empty file named myFile Opens a file in input mode to write to Instructor Explanation: Lecture / Chapter 13 Edit 9. MC 2. Delete (TCO 13) What do the following statements accomplish? ofstream theFile; theFile.open( myFile.txt , ios::out); 4 Points : Opens myFile in read mode Opens myFile in append mode Creates an empty file named myFile Opens a file in input mode to write to Instructor Explanation: Lecture / Chapter 13 Edit...
Words: 2540 - Pages: 11
...Blue Pelican Java by Charles E. Cook Version 3.0.5h Copyright © 2004 - 2008 by Charles E. Cook; Refugio, Tx (All rights reserved) 1-1 “Blue Pelican Java,” by Charles E. Cook. ISBN 1-58939-758-4. Published 2005 by Virtualbookworm.com Publishing Inc., P.O. Box 9949, College Station, Tx 77842, US. ©2005, Charles E. Cook. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, recording or otherwise, without the prior written permission of Charles E. Cook. Manufactured in the United States of America. Preface You will find this book to be somewhat unusual. Most computer science texts will begin with a section on the history of computers and then with a flurry of definitions that are just “so many words” to the average student. My approach with Blue Pelican Java is to first give the student some experience upon which to hang the definitions that come later, and consequently, make them more meaningful. This book does have a history section in Appendix S and plenty of definitions later when the student is ready for them. If you will look at Lesson 1, you will see that we go right to work and write a program the very first day. The student will not understand several things about that first program, yet he can immediately make the computer do something useful. This work ethic is typical of the remainder of the book. Rest assured that full understanding...
Words: 31284 - Pages: 126
...C# Development Rob Miles Edition 1.1 October 2009 Department of Computer Science University of Hull i Contents Introduction...................................................................................................................... 11 Welcome ............................................................................................................. 11 Reading the notes................................................................................................ 11 Getting a copy of the notes ................................................................................. 11 Computers 12 An Introduction to Computers .......................................................................................... 12 Hardware and Software ...................................................................................... 12 Data and Information ........................................................................................................ 13 Data Processing .................................................................................................. 13 Programmer’s Point:At the bottom there is always hardware ............................. 14 Programming Languages 15 What is Programming? ..................................................................................................... 15 From Problem to Program .................................................................................. 15 Programmer’s Point:The specification must always be there...
Words: 63379 - Pages: 254
...Riki Shafier Professor Kimberlee Hoftiezer SOS-110 24 January 2016 Music Education: A Personal Journey For the past few years I have been taking different courses, learning many things and preparing myself for the life ahead of me. As a soon-to-be college graduate, the future beckons, bright and inviting. There are endless career opportunities that await those who have put forth the effort to receive an education. The career goals toward which I am currently preparing are to become a highly sought-after piano teacher and piano-teacher trainer with a full roster of students, complete with a waiting list for those who wish to join my studio. I plan to build a fully- developed business model for my piano studio. This plan will include curricula for various ages and skill levels, as well as plans for accommodating specific needs of individual students. The plan will also have processes for the acceptance and rejection of potential students, registration and payment options, and online booking opportunities. This will be optimized through the use of technology. Technology, in all its many forms, has transformed the world we live in, and I anticipate that it will prove to be of great use to me in the development of my career goals. In the short-term, I will be able to train under experienced piano educators and teacher-trainers via Skype lessons and workshops, and use various training software programs to improve my technical and teaching skills. Additionally, I plan to...
Words: 849 - Pages: 4
...Researching Variable Naming Rules Visual Basic You must use a letter as the first character. You can't use a space, period (.), exclamation mark (!), or the characters @, &, $, # in the name. Name can't exceed 255 characters in length. Generally, you shouldn't use any names that are the same as the functions, statements, and methods in Visual Basic. You end up shadowing the same keywords in the language. To use an intrinsic language function, statement, or method that conflicts with an assigned name, you must explicitly identify it. Precede the intrinsic function, statement, or method name with the name of the associated type library. For example, if you have a variable called Left, you can only invoke the Left function using VBA.Left. You can't repeat names within the same level of scope. For example, you can't declare two variables named age within the same procedure. However, you can declare a private variable named age and a procedure-level variable named age within the same module. Python Must begin with a letter (a - z, A - B) or underscore (_) Other characters can be letters, numbers or _ Case Sensitive Can be any (reasonable) length There are some reserved words which you cannot use as a variable name because Python uses them for other things.- See more at: http://www.w3resource.com/python/python-variable.php#sthash.5AXuVlWN.dpuf Java Variable names are case-sensitive. A variable's name can be any legal identifier — an unlimited-length...
Words: 724 - Pages: 3
...A Programmer’s Guide to Java™ SCJP Certification Third Edition This page intentionally left blank A Programmer’s Guide to Java™ SCJP Certification A Comprehensive Primer Third Edition Khalid A. Mughal Rolf W. Rasmussen Upper Saddle River, New Jersey • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sidney • Tokyo • Singapore • Mexico City Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside the United...
Words: 15086 - Pages: 61
...marks) In this project, you will be creating new classes that are derived from a class called BankAccount. A checking account is a bank account and a savings account is a bank account as well. This sets up a relationship called inheritance, where BankAccount is the superclass and CheckingAccount and SavingsAccount are subclasses. This relationship allows CheckingAccount to inherit attributes from BankAccount (like owner, balance, and accountNumber), but it can have new attributes that are specific to a checking account, like a fee for clearing a check. It also allows CheckingAccount to inherit methods from BankAccount, like deposit, that are universal for all bank accounts. You will write a withdraw method in CheckingAccount that overrides the withdraw method in BankAccount, in order to do something slightly different than the original withdraw method. You will use an instance variable called accountNumber in SavingsAccount to hide the accountNumber variable inherited from BankAccount. The UML diagram for the inheritance relationship is as follows: [pic] Task #1 Extending BankAccount 1. Copy the files AccountDriver.java and BankAccount.java from the Blackboard. BankAccount.java is complete and will not need to be modified. 2. Create a new class called CheckingAccount that extends BankAccount. 3. It should contain a static constant FEE that represents the cost of clearing one check. Set it equal to 15 cents. ...
Words: 1078 - Pages: 5
...Visual Basic – Messages and data input/output Introduction One way for a user to communicate with a procedure is via a dialogue box. The easiest way to do this in VB is to use one of the pre-defined ones. VB has two kinds, a Message box and an Input box. Message box The MsgBox function displays a message, waits for the user to click a button and returns a value indicating which button has been chosen. The simplest MsgBox contains only a message string and an OK button. The general syntax is MsgBox(prompt [,buttons] [,title]), where the quantities within [] are optional arguments, with prompt: string expression displayed in the message (max length 1024 characters) buttons: numerical expression that is sum of values specifying the type of buttons to display, title: string expression displayed in the title bar. Some of the button values are given below. (For a full list see the Help file). Value Constant Display 0 vbOKOnly OK button only 1 vbOKCancel OK and Cancel buttons 3 vbYesNoCancel Yes, No and Cancel buttons 4 vbYesNo Yes and No buttons 32 vbQuestion Query icon 48 vbExclamation Warning message icon 0 vbDefaultButton1 First button is default 256 vbDefaultButton2 Second button is default 512 vbDefaultButton3 Third button is default The value returned by the MsgBox function depends on the button pressed. Some values are listed below. Button selected Value Constant OK 1 vbOK Cancel 2 vbCancel Yes 6 vbYes No 7 vbNo The MsgBox function can be used as a simple debug tool. To...
Words: 930 - Pages: 4
...Kelli Okuly PT1420 Unit 2 Research Assignment 12-5-2014 Variable naming conventions vary from program to program. In Visual Basic the variable must begin with a letter and you cannot use a space, period (.), or the characters !, @, &, $, # in the name. Visual Basic variable names must be under 255 characters long. You shouldn't use any names that are the same as the functions, statements, and methods in Visual Basic. You end up shadowing the same keywords in the language. To use a basic language function, statement, or method that conflicts with an assigned name, you must explicitly identify it. Precede the fundamental function, statement, or method name with the name of the associated type library. For example, if you have a variable called “Left”, you can only use the “Left” function using “VBA.Left”. In Python, variables must begin with a letter or underscore (_). Other characters can be letters, numbers, or the underscore. Python variables are case sensitive and can be any length, within reason. There are several keywords in Python that are reserved for other functions and cannot be used as variables. For example; print, def, from, not, and return. Variables in Java are referred to as Identifiers. In Java the variable must begin with a letter, an underscore, or a dollar sign ($) although a letter is typically what is used. The other characters may be letters or numbers, no spaces or special characters are allowed. Java identifiers can be any length within...
Words: 405 - Pages: 2
...Assignment 1: Fundamentals of Effective Communication in the Workplace Professor BUS 100 – Introduction to Business May 13, 2014 I work for a defense attorney, and I experience effective communication on a daily basis via email with co-workers and clients. However, I do feel that face-to-face communication is highly effective and important. With face-to-face meeting, the co-workers and clients directly receive the message, and feedback is instantly provided. Resolutions can be made easier during a face-to-face meeting rather than via email or phone conversations. About six months ago I was part of a financial turn around that was a result of successful face-to-face communication. The firm’s office that I work for is called McCallum Law Offices, and my position in the department is senior paralegal and office manager. We work closely with the justice department and handling the financial and critical situations of our client’s lives. A main part of my job was to reconcile financial reports, and have the senior attorney approve them, and then submit them for reimbursement. We were having major issues with the financials and how they accounts were being handled. As with most offices now communication is usually handled via e-mail. When you start having issues like we were, there is only one way to handle this and that is for everyone to be face to face. So if there are any issues they can be resolved immediately. Attorney offices can become very hectic...
Words: 526 - Pages: 3
...Craked.com – 6 ways Society Brainwashes You In this article, 5 different methods of social engineering are explored. The first is “Chanting Slogans”. This is considered a method of brainwashing because when chanting a repetitive slogan, the repetitive task keeps your brain busy, instead of considering what has just been said by the analytical part of your brain. This is often used in political stump speeches and conventions with live audiences. The second method mentioned is “Slipping things into your Subconscious”. A sly technique used by headline writers to place and reinforce a certain idea in the reader’s head without them noticing. Also called “Source Amnesia” this method exploits the brain’s weak capacity to remember things, but not remember the context in which we learned them. The third process of social engineering the author considered was “Keeping You in Line with Shame”. This involves the “appeal to ridicule fallacy” where the speaker ridicules his/or her opponent’s point, and thus the listener is more likely to agree, in fear of being on the side of the ridicule. The fourth method analyzed is called “Black and White choices”. The psychology behind this is that when people are in debate, they paint an idea or person or place as all bad or all good. Therefore, people are less likely to consider the multiple complex layers of an idea if it is wholly labeled as “bad”. The last and final method is “Us versus Them”. This is the idea that humans naturally form groups within...
Words: 299 - Pages: 2
...demand for its products? Forecasting should include the use of both quantitative and qualitative approaches to forecast demand for its products. If Avie Products Inc. were to use the quantitative method, they would do so using the trend analysis. Avie’s employment requirements could be forecasted on the basis of sales. Once the sales are analyzed, Avie can plot a historical trend of the sales in relation to the number of employees. Avie would then calculate the productivity in the last five years, and then calculate HR demand by multiplying the sales by the productivity ratio. This would then project Avie’s HR demand out to the target year. While the qualitative approach is necessary, having the numbers without management’s input is not as useful. If Avie Product’s Inc. were to also use the qualitative method, the management forecast could be used. This approach would use the opinions of Avie’s supervisors, department managers, experts or anyone else knowledgeable about their employment needs. 2. What HR planning would assist Avie in determining how many additional workers it would need for the third shift? Avie would again need to forecast the number of future employees needed for the third shift. In order to determine how many additional workers Avie would need, the method of staffing tables could be used. Staffing tables would...
Words: 325 - Pages: 2
...Juliana golia Biology 1. Aim. My aim is to use the method of capture-recapture and see how many are recapture back and also estimate the population size. 2. Materials. * Ice cream blow * Ruler * Beads of colour 1(20) * Beads of colour 2(300). 3. Method. * Fill the ice cream blow with colour 2. * Fill also the ice cream blow with colour 1. * Mix it all together. * Pick out 15 beads (without not looking note how many are colour 1. * I then draw a table with two column, one recapture and the other one number of tagged. * I repeat this step twelve times recording each as I go along. * Then total the result and calculate the average number of colour 1. * I latter calculate the total population. * Then count the total of beads that were in the ice cream blow (both colour 1 &2). 4. Results recapture | Number of tagged | 1 | 3 | 2 | 3 | 3 | 1 | 4 | 3 | 5 | 2 | 6 | 2 | 7 | 2 | 8 | 4 | 9 | 2 | 10 | 3 | 11 | 4 | 12 | 4 | 20*15 =300 | 33/12 | 300/2.75=109.0909… | 2.75 | | | | | 5. Conclusion. My aim wasn’t successfully achieved, I might have count it wrong or I didn’t count the total numbers of beads well, so this might cause the result to be inaccurate. 6. Discussion. A. The actual number was 128 and mine was 109.09.., so it was close but not very actual. B. No I might have count it wrong, this may cause the result to be inaccurate. C...
Words: 312 - Pages: 2