...QUESTIONNAIRE: Name:…………………………. Sex: Male Female Email id:…………………………………… Age: Below 20 yrs 20-30 yrs 30-40 yrs Above 40 yrs Occupation: Employee Student Professional Business Housewife Monthly house hold income: Less than 10,000 10-25,000 25-40,000 40,000 and above Q1) Which Car do you own? Mercedes Lexus Others, please specify _________________ Q2) Which Model do you own? Mercedes Lexus CLS550 C63 LS400 GS400 CL63 S500 LS430 GS300 C300 C240 ...
Words: 478 - Pages: 2
...In some ways I’d say it is good to feel pain or else your life is not real, to live life without pain and hardships, makes you lazy and ordinary. No man has ever become great by sleeping all day long. To attain success pain must become a secondary objective and the goal to be achieved primary. Focus is most important, and that is when it does not matter whether you slept 2 hours or 8, or whether you ran 8km or 100m but what is important is whether you have achieved what you set out to do. Having said this we must not set our goals low, in order to gain satisfaction at having achieved it. Our goals must be reasonably high, if you aim for the stars you might at least land on the moon. Richard Branson never imagined that being dyslexic and dropping out of school at a young age would prevent him from reaching where he wanted to. He set his heights on what others would have seen as impossible, but it is this high level of self belief that got him to where he is now. When Ferdinand Piëch laid down 10 parameters in order to manufacture the VW Phaeton, half his engineers walked out believing those parameters were beyond possible. But today we see the Phaeton will all those parameters included, and still making it cheaper than the Mercedes S500. To aim high and dream big is nothing wrong as long as you do not keep dreaming. Motivation, hard work, perspiration are all tools to achieve the impossible. Success comes with 1% inspiration and 99% perspiration. To be inspired is not enough...
Words: 341 - Pages: 2
...Employee Absenteeism Kmart Corporation Alvin Williams Professor Whatley LG415 Quality Control Park University INTRODUCTION The purpose of this research paper is to identify employee absenteeism and explain the process of how Kmart was able to successfully merge with Sears effectively without completely diminishing employee morale and loyalty. Let us first begin by going into detail to primarily explain what employee absenteeism is. In the workforce it is described as a failure to appear for work in a routine period of time. It also means the number of occurrences of missed work without valid reasoning. Picture the scenario that you are shopping in Kmart and you have finally completed your shopping to proceed to check out. The time just so happens to be three o’clock, which are the shift change hours for cashiers. There are three customers ahead of you and only two lanes open. You notice that there is a delay in check out times. You finally get to the counter to pay and over hear the cashier complaining that she will have to stay another two hours because her replacement has called out sick once again, without proper notice. At this point the cashier becomes a little irritated in her responses and appears to be in no way interested in pleasing the customer. What happened to the employee that was smiling just three customers before you? I can easily explain. The motivation the...
Words: 2935 - Pages: 12
...Package ‘quantmod’ July 24, 2015 Type Package Title Quantitative Financial Modelling Framework Version 0.4-5 Date 2015-07-23 Depends xts(>= 0.9-0), zoo, TTR(>= 0.2), methods Suggests DBI,RMySQL,RSQLite,timeSeries,its,XML,downloader Description Specify, build, trade, and analyse quantitative financial trading strategies. LazyLoad yes License GPL-3 URL http://www.quantmod.com https://github.com/joshuaulrich/quantmod BugReports https://github.com/joshuaulrich/quantmod/issues NeedsCompilation yes Author Jeffrey A. Ryan [aut, cph], Joshua M. Ulrich [cre, ctb], Wouter Thielen [ctb] Maintainer Joshua M. Ulrich Repository CRAN Date/Publication 2015-07-24 21:10:42 R topics documented: quantmod-package addADX . . . . . . addBBands . . . . addCCI . . . . . . addExpiry . . . . . addMA . . . . . . addMACD . . . . . addROC . . . . . . addRSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Words: 4206 - Pages: 17
...Shape class
/** * This is a class that represent any shape. This is the superclass of all shapes. * @author yklam2 * */ public class Shape { private boolean canvas[][]; private int width; private int height; /** * Create an empty shape. */ public Shape() { this(0, 0); } /** * Create a shape with a specific width
and height
. * @param width The width
of this shape. * @param height The height
of this shape. */ protected Shape(int width, int height) { this.width = width; this.height = height; canvas = new boolean[height][width]; } /** * Set a pixel * @param row The row
of the pixel. * @param column The column
of the pixel. */ protected void setPixel(int row, int column) { if(row >=0 && row < height && column >=0 && column < width) canvas[row][column] = true; } /** * Clear a pixel * @param row The row
of the pixel. * @param column The column
of the pixel. */ protected void clearPixel(int row, int column) { if(row >=0 && row < height && column >=0 && column < width) canvas[row][column] = false; } /** * Get the area of this shape. Area is the number of pixel set in this * @return The area. */ public int getArea() { int area = 0;
shape.
for(boolean [] row: canvas) for(boolean pixel: row) if(pixel) ++area; } return area;
/* (non-Javadoc) * @see java.lang.Object#toString() */ public String toString() { String drawing = ""; for(boolean [] row: canvas) { if(drawing.length() > 0) //...
Words: 704 - Pages: 3
...util.ArrayList; public class Student { // Declare the variables private String name; private ArrayList homeworks; // Constructor with one argument public Student(String name) { this.name = name; this.homeworks = new ArrayList(); } // setter or mutator methods change the field values public void setName(String name) { this.name = name; } //Accessor or getter methods provide the field values public String getName() { return name; } public void addHomeworkGrade(int newGrade){ this.homeworks.add(newGrade); } //average homework score public double getComputeAverage(){ int total = 0; //loop through homeworks, add to total for(Integer grade : this.homeworks){ total += grade; } //calculate average double average = total / (double)this.homeworks.size(); return average; } //Override the toString method to return the string representation public String toString() { DecimalFormat pattern = new DecimalFormat("0.00"); return (getName() + "'s average grade is " + pattern.format(getComputeAverage())); } } ------------------------ import java.io.FileReader; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.Queue; import java.util.Set; import java.util.StringTokenizer; public class Test { public static void...
Words: 366 - Pages: 2
...OBJECT ORIENTED PROGRAMMING IN JAVA ‐ EXERCISES CHAPTER 1 1. Write Text‐Based Application using Object‐Oriented Approach to display your name. // filename: Name.java // Class containing display() method, notice the class doesnt have a main() method public class Name { public void display() { System.out.println("Mohamed Faisal"); } } // filename: DisplayName.java // place in same folder as the Name.java file // Class containing the main() method public class DisplayName { public static void main(String[] args) { Name myname = new Name(); // creating a new object of Name class myname.display(); // executing the display() method in the Name class } } 2. Write a java Applet to display your age. // filename: DisplayNameApplet.java import java.applet.Applet; // import necessary libraries for an applet import java.awt.Graphics; public class DisplayNameApplet extends Applet { public void paint(Graphics g) { g.drawString("Mohamed Faisal", 50, 25); } } // filename: DisplayNameApplet.htm // place in same folder as the compiled DisplayNameApplet.class file Displaying my Name CHAPTER 2 3. Write a program that calculates and prints the product of three integers. // filename: Q1.java import java.util.Scanner; // import Scanner libraries for input public class Q1 { public static void main(String[] args) { Scanner input = new Scanner (System.in); int number1; int number2; int number3; System.out.println("Enter the First Number"); www.oumstudents...
Words: 3130 - Pages: 13
...public class URLReader { public static void main(String[] args) throws Exception { URL yahoo = new URL("http://www.lelong.com/"); BufferedReader in = new BufferedReader( new InputStreamReader( yahoo.openStream())); String inputLine; for ( int i =0;(inputLine = in.readLine()) != null; i++){ System.out.println(inputLine);} in.close(); } } LAB EXERCISE 2: Echo Client EchoClient .java import java.io.*; import java.net.*; public class EchoClient { public static void main(String[] args) { try { Socket s = new Socket("127.0.0.1", 9999); BufferedReader r = new BufferedReader(new InputStreamReader(s.getInputStream())); PrintWriter w = new PrintWriter(s.getOutputStream(), true); BufferedReader con = new BufferedReader(new InputStreamReader(System.in)); String line; do { line = r.readLine(); if ( line != null ) System.out.println(line); line = con.readLine(); w.println(line); } while ( !line.trim().equals("bye") ); } catch (Exception err) { System.err.println(err); } } } LAB EXERCISE 3:MULTI THREADS SimpleThreads.java public class SimpleThreads { //Display a message, preceded by the name of the current thread static void threadMessage(String message) { String threadName = Thread.currentThread().getName(); System.out.format("%s: %s%n", threadName, message); } private static class MessageLoop...
Words: 1219 - Pages: 5
...methods. Explore the Object class and its toString() method. Explain polymorphism, dynamic binding, and generic programming. Explain how to cast Objects and implement the instanceOf operator. Restrict access to data and methods using the protected visibility modifier. Declare constants, unmodifiable methods, and nonextendable classes using the final modifier. Use the this keyword to refer to the calling object. Assignment Requirements The following homework is designed to cover the course objectives for Unit 6. The following questions require you to do research and examine the questions to find the correct answer to the 20 questions listed below. 1. The following two programs display the same result. // Program 1 public class Test { public static void main(String[] args) { Object a1 = new A(); Object a2 = new A(); System.out.println(((A)a1).equals((A)a2)); } } class A { int x; public boolean equals(A a) { return this.x == a.x; } } // Program 2 public class Test { public static void main(String[] args) { A a1 = new A(); A a2 = new A(); System.out.println(a1.equals(a2)); } } class A { int x; public boolean equals(A a) { return this.x == a.x; } } a. True 2. Encapsulation means ______________. a. that data fields should be declared private 3. What is the output of the following code? import java.util.Date; public class Test { public static void...
Words: 973 - Pages: 4
...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 comes in time. Abraham Lincoln himself subscribed to this philosophy when he said, “Stop petting the mule, and load the wagon.” The usual practice in most Java textbooks of introducing classes and objects alongside the fundamental concepts of primitive variable types, loops, decision structures, etc. is deferred until the student has...
Words: 31284 - Pages: 126
...C# Language Specification Version 4.0 Notice © 1999-2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Visual Basic, Visual C#, and Visual C++ are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries/regions. Other product and company names mentioned herein may be the trademarks of their respective owners. Table of Contents 1. Introduction 1 1.1 Hello world 1 1.2 Program structure 2 1.3 Types and variables 4 1.4 Expressions 6 1.5 Statements 8 1.6 Classes and objects 12 1.6.1 Members 12 1.6.2 Accessibility 13 1.6.3 Type parameters 13 1.6.4 Base classes 14 1.6.5 Fields 14 1.6.6 Methods 15 1.6.6.1 Parameters 15 1.6.6.2 Method body and local variables 16 1.6.6.3 Static and instance methods 17 1.6.6.4 Virtual, override, and abstract methods 18 1.6.6.5 Method overloading 20 1.6.7 Other function members 21 1.6.7.1 Constructors 22 1.6.7.2 Properties 23 1.6.7.3 Indexers 23 1.6.7.4 Events 24 1.6.7.5 Operators 24 1.6.7.6 Destructors 25 1.7 Structs 25 1.8 Arrays 26 1.9 Interfaces 27 1.10 Enums 29 1.11 Delegates 30 1.12 Attributes 31 2. Lexical structure 33 2.1 Programs 33 2.2 Grammars 33 2.2.1 Grammar notation 33 2.2.2 Lexical grammar 34 2.2.3 Syntactic grammar 34 2.3 Lexical analysis 34 2.3.1 Line terminators 35 2.3.2 Comments 35 2.3.3 White space 37 2.4 Tokens 37 2.4.1 Unicode character escape sequences 37 2.4.2 Identifiers 38 2.4.3 Keywords 39 ...
Words: 47390 - Pages: 190
...Oct 23 2015 *Topic: Sequential Structure *Name of program: Hello1 *Description of program: Greetings to the person who is using the program. *--------------------------------------------------------------------------------------------------------------------------------------*/ Import java.util.* class Hello1 { public static void main (String[] args){ System.out.println("Hello world!"); System.out.print("Hello "); System.out.print("again, "); System.out.println("world"); System.out.println(); System.out.println("Goodbye world!"); System.out.println(); System.out.println("Linz Aaron A. Danganan"); System.out.println(); System.out.println("Lourdes Extension"); System.out.println(); System.out.println("Walang Forever."); System.out.println(); } } /*Programmer: Danganan, Linz Aaron A. *Date: OCT 23 2015 *Topic: Sequential Structure *Name of program: Hello 2 *Description of program: Basic Biography of the person who is using the program. *--------------------------------------------------------------------------------------------------------------------------------------*/ import java.util.*; class Hello2{ public static void main (String[] args){ Scanner kboard = new Scanner(System.in); System.out.println("Welcome!"); System.out.print("What is your name? "); String name = kboard.nextLine(); System.out.println("Hello, " + name); System.out.print("How old are you? "); ...
Words: 2828 - Pages: 12
...Unit 9 Assignment · Which of the following statements converts a double value d into a string s? · s = new Double(d).stringOf(); · s = String.stringOf(d); · s = (new Double(d)).toString(); · s = (Double.valueOf(s)).toString(); The answer is D · Assume Calendar calendar = new GregorianCalendar(). Which of the following statements will return the number of days in a month? · calendar.getActualMaximum(Calendar.DAY_OF_MONTH) · calendar.get(Calendar.MONTH_OF_YEAR) · calendar.get(Calendar.WEEK_OF_MONTH) · calendar.get(Calendar.WEEK_OF_YEAR) · calendar.get(Calendar.MONTH) The answer is E · Assume Calendar calendar = new GregorianCalendar(). Which of the following statements will return the week of the year? · calendar.get(Calendar.MONTH_OF_YEAR) · calendar.get(Calendar.WEEK_OF_YEAR) · calendar.get(Calendar.WEEK_OF_MONTH) · calendar.get(Calendar.MONTH) The answer is B · What will be the output of running the class Test with the following code lines? interface A { } class C { } class B extends D implements A { } public class Test extends Thread { public static void main(String[] args) { B b = new B(); if (b instanceof A) System.out.println("b is an instance of A"); if (b instanceof C) System.out.println("b is an instance of C"); } } class D extends C { } · b is an instance of A followed by b is an instance of C. ·...
Words: 1250 - Pages: 5
...1st Semester Academic Probation Appeal Form and Letter *Return to Mrs. Bennett by January 6, 2012 Name ____________________________________ Grade__________________ Parent/Guardian Name(s) ___________________________________________ Parent/Guardian Phone Number(s) ____________________________________ Parent/Guardian Address ____________________________________________ Date Information Completed _____________________ 1. Complete the information regarding your classes below: Class | Teacher | Number of Absences | Number of Tardies | Current Grade in Class | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2. Attach a typed/legible letter explaining your absences and provide information to the attendance committee on why you deserve to keep your credit. (See sample letter on the back.) Letter must be submitted with form by 01/06/2012. *Decisions regarding whether you will be denied or granted credit will be made by Friday, January 13, 2012. Sample Appeal Letter Dear Attendance Committee; I am writing this letter of appeal in response to my attendance this past semester. I am fully aware of the attendance policy set forth by the school and the district as well as the fact that it is state law. I also am aware that attendance in school is directly related to my success as a student and I take this responsibility seriously. My education is my responsibility and it is something...
Words: 399 - Pages: 2
...different interface than our caller. Alternative 1: Re-write the caller o Ugly, messy, error-prone (Equivalent to changing the power cable in our electrical plug when we go abroad) Alternative 2: Re-write the called libraries/classes o May not have the source code o As ugly and error-prone as Alternative 1 Alternative 3: Write an adapter The adapter converts all requests to a language the adaptee understands See http://mypages.valdosta.edu/dgibson/courses/cs4322/Lessons/Adap ter/AdapterNotes.pdf Another example Client class programmed against a Vendor class. Thus, the Client is strongly coupled with the Vendor class. Later, it is decided to change vendors. Vendor2 is selected which has different method names. Example (cont’d) The Client must be modified in order to adapt to the new vendor. What was the problem? The Client class encapsulates some portion of application logic, which is intertwined with the Vendor class. This causes the strong coupling/ dependence. Thus, modifying the Client code to adapt to the new vendor could result in errors being injected into the application logic. How do we mitigate this situation where we have a Client coded against a Vendor, where the Vendor will change? Two helpful design principles • Identify the aspects of your application that vary and separate them from what stays the same. • Program to an interface, not an implementation. • The first principle suggests that we separate the application logic from...
Words: 1481 - Pages: 6