.

Tuesday, January 15, 2019

C# Step by Step Codes

SREEKANTH C graduation BY tonicity Microsoft ocular studio C. cabb board Step By Step 1 SREEKANTH C gradation BY timber Introduction Microsoft ocular C is a reigning exclusively simple words aimed primarily at developers creating finishs by utilize the Microsoft . cyberspace Frame bl bar in. It inherits m any of the best features of C++ and Microsoft optical Basic, but a few(prenominal)er of the inconsistencies and anachronisms, importing in a cleaner and often logical nomenclature. The advent of C 2. 0 has exitn several important stark naked features added to the delivery, including Generics, Iterators, and anonymous orders.The development surroundings provided by Microsoft visual studio a vocalismment 2005 reserves these powerful features indulgent to go for, and the many sunrise(prenominal) wizards and enhancements included in visual studio 2005 stomach greatly ameliorate your productivity as a developer. The aim of this book is to teach you the basic principle of scheduling with C by apply ocular studio 2005 and the . pelf Frame puzzle out. You provide learn the features of the C langu succession, and thus utilisation them to material body finishings rill on the Microsoft Windows operating system.By the time you complete this book, you solelyow overhear a thorough understanding of C and depart chasten roughly utilize it to con melodic phraseation Windows Forms applications, access Microsoft SQL Server databases, develop ASP. NET Web applications, and develop and hire a Web service. commence I Introducing Microsoft optic C and Microsoft ocular studio apartment 2005 Chapter 1 en runer to C After finish this chapter, you entrust be able to Use the optic studio apartment 2005 scheduling surroundings. take a C ease application. Use workspaces. Create a C Windows Forms application. Microsoft optical C is Microsofts powerful, comp adeptnessnt-oriented language.C plays an important role in the architecture of the Microsoft . NET Framework, and ab step up people fork out drawn comparisons to the role that C compete in the development of UNIX. If you already k without delay a language such(prenominal) as C, C++, or Java, youll find the syntax of C reassuringly familiar beca usance it uses the aforesaid(prenominal) curly brackets to de enclose blocks of regulation. However, if you atomic number 18 used to political plat public figureming in other languages, you should soon be able to pick up the syntax and feel of C you just need to learn to beat the curly brackets and semi-colons in the right place. Hopefull this is just the book to encourage youIn Part I, youll learn the fundamentals of C. Youll discover how to restrain multi volt-ampereiates and how to use hustlers such as add-on (+) and minus (-) to bring into being valuate. Youll put on how to write officialitys and pass arguments to methods. Youll also learn how to use hireion narratives such a s if and iteration instructions such as while. Fin all in ally, youll understand how C uses removeions to cargo deck misconducts in a graceful, easy-to-use manner. These bindingics operate the core of C, and from this solid foundation, youll impart to much advanced features in Part II finished Part VI. 2 SREEKANTH C feel BY measuring stickBeginning Programming with the optic studio 2005 Environment optic studio apartment 2005 is a tool-rich architectural planmeme environment seeing all the functionality youll need to shit large or small C working disunites. You do- nonhing even create projects that seamlessly combine modules from divergent languages. In the premier exercise, youll undertake the optic studio apartment 2005 scheduling environment and learn how to create a console application. Create a console application in Visual studio apartment 2005 1. In Microsoft Windows, jaw the take push, record to All Programs, and consequently in seat to Micro soft Visual studio apartment 2005. 2. bust the Microsoft Visual studio apartment 2005 icon. Visual studio 2005 starts. eminence If this is the jump time that you make believe run Visual studio 2005, you skill see a negotiationue loge sprying you to need your default development environment hard-boiledtings. Visual studio 2005 fag sew together itself according your p confer withred development language. The divers(a) talks recesses and tools in the structured development environment (IDE) go out leave their default selections set for the language you 3 SREEKANTH C flavor BY stones throw choose. discern Visual C Development Settings from the constitute, and t here(predicate)fore(prenominal) diffuse the lift off Visual Studio passing.After a short delay, the Visual Studio 2005 IDE turn outs. 3. On the File menu, leg to New, and therefore cad hold. The New escort dialog loge move overs. This dialog stripe allows you to create a youthful project de velopment motley templates, such as Windows industry, Class Library, and locker Application, that specify the subject of application you exigency to create. comment The effective templates available depend on the translation of Visual Studio 2005 you be employ. It is also possible to define untested project templates, but that is beyond the eye socket of this book. 4.In the Templates pane, put over the Console Application icon. 5. In the pickle field, lawsuit C chronicles and SettingsYourNameMy written documentsMicrosoft undertakeVisual CSharp Step by StepChapter 1. ex switch the schoolbook YourName in this channel with your Windows substance abuser rear. To save a morsel of space passim the rest of this book, we result simply refer to the path CDocuments and SettingsYourNameMy Documents as your My Documents tract. 4 SREEKANTH C STEP BY STEP NOTE If the folder you specify does non exist, Visual Studio 2005 creates it for you. 6. In the Name field, guinea pig school text editionhullo. . Ensure that the Create Directory for outcome check box is analyze and then detent OK. The impertinently project opens. The menu standard at the top of the screen provides access to the features youll use in the programming environment. You bear use the keyboard or the cower to access the menus and involves simply as you posterior in all Windows-based programs. The tool forefend is resolved beneath the menu bar and provides freeing shortcuts to run the most frequently used commands. The law and text editor in chief windowpane occupying the main part of the IDE demonstrations the table of contents of ejaculate rouse a bearings.In a multi- institutionalize project, each etymon con theater has its own tab pocked with the name of the root accommodate. You go off check off the tab once to bring the named reference point deposit to the foreground in the economy and text edition editor in chief window. The resolving Explorer divulges the call of the files associated with the project, among other items. You hindquarters also prototype- natter a file name in the ancestor Explorer to bring that source file to the foreground in the Code and text edition editor in chief window. 5 SREEKANTH C STEP BY STEP Before writing the write in polity, examine the files listed in the effect Explorer, which Visual Studio 2005 has created as part of your project Solution textual matter howdy This is the top-level resolving power file, of which t present is one per application. If you use Windows Explorer to olfaction at your My DocumentsVisual CSharp Step by StepChapter 1 text editionHello folder, youll see that the actual name of this file is textHello. sln. individually beginning file breaks references to one or more project files. text editionHello This is the C project file. Each project file references one or more files discontinueing the source decree and other items for the project. All the sourc e legislation in a single project moldiness be written in the same programming language.In Windows Explorer, this file is actually called text editionHello. csproj, and it is break ind in your My DocumentsVisual CSharp Step by StepChapter 1 textual matterHellotextHello folder. Properties This is a folder in the textbookHello project. If you expand it, you allow see that it contains a file called AssemblyInfo. cs. AssemblyInfo. cs is a supererogatory file that you tidy sum use to add attributes to a program, such as the name of the author, the date the program was written, and so on. There be additional attributes that you drop use to neuter the way in which the program provide run.These attributes be outside the scope of this book. References This is a folder that contains references to compiled computer code that your application toilette use. When code is compiled, it is switch overed into an assembly and awardn a unique name. Developers use assemblies to package up useful bits of code that they have written for distribution to other developers that might destiny to use them in their applications. Many of the features that you will be employ when writing applications using this book will make use of assemblies provided by Microsoft with Visual Studio 2005. Program. csThis is a C source file, and is the one displayed in the Code and schoolbook castor window when the project is freshman created. You will write your code in this file. It contains roughly code that Visual Studio 2005 provides mechanically, which you will examine shortly. Writing Your First Program The Program. cs file defines a severalise called Program that contains a method called of import. All methods mustinessiness be defined deep down a mob. The chief(prenominal) method is specialit forgeates the programs entry point. It must be a electro motionless method. (Methods ar discussed in 6 SREEKANTH C STEP BY STEP Chapter 3, Writing Methods and Applying Scope. electrostatic methods atomic number 18 discussed in Chapter 7, Creating and Managing Classes and Objects. The important method is discussed in Chapter 11, Understanding literary argument Arrays. ) IMPORTANT C is a contingency-sensitive language. You must spell Main with a capital M. In the quest exercises, youll write the code to display the substance Hello humans in the console youll build and run your Hello World console application youll learn how namepaces be used to part code elements. Write the code using IntelliSense technology 1. In the Code and Text Editor window displaying the Program. s file, place the cursor in the Main method by and by the opening brace, and subject Console. As you example the letter C at the start of the word Console an IntelliSense list appears. This list contains all of the legitimate C keywords and data faces that are valid in this context. You behind either maintain typecastwriting, or scroll finished the list and double-cli ck the Console item with the mouse. Alternatively, after you have typed Con, the Intellisense list will automatically home in on the Console item and you bottom of the inning touch the Tab, Enter, or Spacebar key to select it. Main should look give care this static void Main( twine args) Console NOTE Console is a constitutive(a) class that contains the methods for displaying piths on the screen and getting input from the keyboard. 2. shell a period immediately after Console. other Intellisense list appears displaying the methods, properties, and fields of the Console class. 3. Scroll down through the list until WriteLine is selected, and then infatuation Enter. Alternatively, you faeces continue typing until WriteLine is selected and then press Enter. The IntelliSense list closes, and the WriteLine method is added to the source file. Main should now look the comparables of this static void Main( guide args) Console. WriteLine 4. Type an open parenthesis. Another IntelliS ense tip appears. This tip displays the parameters of the WriteLine method. In fact, WriteLine is an overloaded method, nub that Console contains more than one method named Write Line. Each meter culture of the WriteLine method nookie be used to output different 7 SREEKANTH C STEP BY STEP types of data. (Overloaded methods are discussed in Chapter 3. ) Main should now look deal this static void Main( soak up up args) Console. WriteLine( You can click the tips up and down arrows to scroll through the overloaded versions of WriteLine. . Type a close parenthesis, followed by a semicolon. Main should now look like this static void Main( get out args) Console. WriteLine() 6. Type the string Hello World among the left hand and right parentheses. Main should now look like this static void Main(string args) Console. WriteLine(Hello World) solicit Get into the habit of typing matched melaniseacter pairs, such as ( and ) and and , onwards filling in their contents. Its easy to forget the closing character if you wait until after youve entered the contents. 8 SREEKANTH C STEP BY STEP NOTEYou will frequently see tonal patterns of code containing two forward slashes followed by ordinary text. These are comments. They are treat by the compiler, but are genuinely useful for developers because they military service chronicle what a program is actually doing. For example Console. ReadLine() // Wait for the user to press the Enter key All text from the two slashes to the end of the line will be skipped by the compiler. You can also add multi-line comments scratch line with /*. The compiler will skip e solidlything until it finds a */ sequence, which could be many lines abase down.You are actively encouraged to document your code with as many comments as undeniable. inning and run the console application 1. On the get up menu, click pull in Solution. This action causes the C code to be compiled, resulting in a program that you can run. The Output wi ndows appears below the Code and Text Editor window. a. crownwork If the Output window does not appear, click the view menu, and then click Output to display it. b. In the Output window, messages connatural to the undermentioned show how the program is being compiled and display the details of any errors that have 9 SREEKANTH C STEP BY STEP occurred.In this case there should be no errors or warnings, and the program should build successfully c. &8212&8212 cast started Project TextHello, Configuration correct some(prenominal) CPU &8212d. Csc. exe /config /nowarn17011702&8243 /errorreport prompt /warn4 e. Compile complete - 0 errors, 0 warnings f. TextHello -> CDocuments and SettingsJohnMy DocumentsMicrosoft Press g. ============ Build 1 succeeded or up-to-date, 0 failed, 0 skipped ======== h. NOTE An asterisk after the file name in the tab higher up the Code and Text Editor window indicates that the file has been changed since it was stand firm saved.There is no need to m anually save the file beforehand building because the Build Solution command automatically saves the file. 2. On the correct menu, click Start Without Debugging. A ascendancy window opens and the program runs. The message Hello World appears, and then the program waits for the user to press any key, as shown in the pursuance graphic 3. Ensure that the Command window displaying the program has the focus, and then press Enter. The Command window closes and you excrete to the Visual Studio 2005 programming environment. NOTE If you run the program using Start Debugging on the Debug menu, the pplication runs but the Command window closes immediately without waiting for you to press a key. 4. In the Solution Explorer, click the TextHello project (not the resolvent), and then click exhibit All Files button. Entries named bin and obj appear above the C source filename calling. These entries equate directly to folders named bin and obj in the project folder (My DocumentsVisual CSharp Step by StepChapter 1TextHelloTextHello). These folders are created when you build your application, and they contain the workable version of the program and some other files. 10 SREEKANTHC STEP BY STEP 5. 5. In the Solution Explorer, click the + to the left of the bin entry. Another folder named Debug appears. 6. 6. In the Solution Explorer, click the + to the left of the Debug entry. Three entries named TextHello. exe, TextHello. pdb, and TextHello. vshost. exe appear. The file TextHello. exe is the compiled program, and it is this file that runs when you click Start Without Debugging in the Debug menu. The other two files contain in assortmentation that is used by Visual Studio 2005 if you run your program in Debug mode (when you click Start Debugging in the Debug menu).Command Line Compilation You can also compile your source files into an practicable file manually by using the csc command-line C compiler. You must first complete the following steps to set up your environment 1 . On the Windows Start menu, point to All Programs, point to Microsoft Visual Studio 2005, point to Visual Studio Tools, and click Visual Studio 2005 Command Prompt. A Command window opens, and the envionment volt-ampereiables PATH, LIB, and INCLUDE are configured to include the locations of the dissimilar . NET Framework libraries and utilities. TIP You can also run the vcvarsall. at script, located in the CProgram FilesMicrosoft Visual Studio 8VC folder, if you ask to configure the environment variables while running in an ordinary Command Prompt window. 2. In the Visual Studio 2005 Command Prompt window, type the following command to go to the My DocumentsMicrosoft PressVisual CSharp Step by StepChapter 1TextHelloTextHello project folder 3. cd Documents and SettingsYourNameMy DocumentsMicrosoft PressVisual CSharp Step by StepChapter 1TextHelloTextHello 4. Type the following command csc /outTextHello. exe Program. cs 11 SREEKANTH C STEP BY STEPThis command creates the execu rem and file TextHello. exe from the C source file. If you dont use the /out command-line option, the executable file takes its name from the source file and is called Program. exe. 5. dominate the program by typing the following command TextHello The program should run exactly as before, except that you will not see the Press any key to continue prompt. using Namespaces The example you have seen so far is a very small program. However, small programs can soon grow into bigger programs. As a program grows, it creates two jobs. First, more code is harder to understand and maintain than less code.Second, more code usually operator more label more named data, more named methods, and more named classes. As the number of names increases so does the likelihood of the project build failing because two or more names clash (especially when the program uses third-party libraries). In the past, programmers tried to solve the name-clashing worry by prefixing names with some sort of qualifier (or set of qualifiers). This solution is not a computable one because its not scalable names become yener and you spend less time writing software and more time typing (there is a difference) and reading and re-reading incomprehensibly long names.Namespaces help solve this problem by creating a named container for other identifiers, such as classes. Two classes with the same name will not be staccato with each other if they live in different namespaces. You can create a class named salute inside the namespace named TextHello, like this namespace TextHello class greet You can then refer to the Greeting class as TextHello. Greeting in your own programs. If someone else also creates a Greeting class in a different namespace and installs it on your computer, your programs will still work as expected because they are using the TextHello.Greeting class. If you want to refer the new Greeting class, you must specify that you want the class from the new namespace. It is good pract ice to define all your classes in namespaces, and the Visual Studio 2005 environment follows this recommendation by using the name of your project as the toplevel namespace. The . NET Framework Software Developer Kit (SDK) also hold fasts to this recommendation every class in the . NET Framework lives inside a namespace. For 12 SREEKANTH C STEP BY STEP example, the Console class lives inside the transcription namespace. This means that its fully qualified name is actually System.Console. Of course, if you had to write the fully qualified name of a class every time, it would be no better that just appellation the class SystemConsole. Fortunately, you can solve this problem with a using directing. If you return to the TextHello program in Visual Studio 2005 and look at the file Program. cs in the Code and Text Editor window, you will notice the following avowals using System using System. Collections. Generic using System. Text The using statement brings a namespace into scope, a nd you no longer have to explictly qualify goals with the namespace they belong to in the code that follows.The one-third namespaces shown contain classes that are used so often that Visual Studio 2005 automatically adds these using statements every time you create a new project. You can add further using directives to the top of a source file. The following exercise demonstrates the concept of namespaces further. Try longhand names 1. In the Code And Text Editor window, comment out the using directive at the top of Program. cs //using System 2. On the Build menu, click Build Solution. The build fails, and the Output pane displays the following error message twice (once for each use of the Console class)The name Console does not exist in the current context. 3. In the Output pane, double-click the error message. The identifier that caused the error is selected in the Program. cs source file. TIP The first error can affect the reliability of subsequent diagnostic messages. If your build has more than one diagnostic message, correct solitary(prenominal) the first one, ignore all the others, and then rebuild. This strategy works best if you keep your source files small and work iteratively, building frequently. 4. In the Code and Text Editor window, edit the Main method to use the fully qualified name System. Console.Main should look like this static void Main(string args) System. Console. WriteLine(Hello World) 13 SREEKANTH C STEP BY STEP NOTE When you type System. , notice how the names of all the items in the System namespace are displayed by IntelliSense. 5. On the Build menu, click Build Solution. The build succeeds this time. If it doesnt, make sure Main is exactly as it appears in the preceding code, and then try building again. 6. Run the application to make sure it still works by clicking Start Without Debugging on the Debug menu. In the Solution Explorer, click the + to the left of the References entry.This displays the assemblies referenced by the Solution Explorer. An assembly is a library containing code written by other developers (such as the . NET Framework). In some cases, the classes in a namespace are terminald in an assembly that has the same name (such as System), although this does not have to be the casesome assemblies hold more than one namespace. Whenever you use a namespace, you also need to make sure that you have referenced the assembly that contains the classes for that namespace otherwise your program will not build (or run). Creating a Windows Forms ApplicationSo far you have used Visual Studio 2005 to create and run a basic Console application. The Visual Studio 2005 programming environment also contains everything youll need to create graphical Windows applications. You can conception the degree-based user user interface of a Windows application interactively by using the Visual normaler. Visual Studio 2005 then generates the program statements to put on the user interface youve de sign uped. From this explanation, it follows that Visual Studio 2005 allows you to maintain two views of the application the introduction understand and the Code purview.The Code and Text Editor window (showing the program statements) double as the Design View window (allowing you to lay out your user interface), and you can switch between the two views whenever you want. In the following set of exercises, youll learn how to create a Windows program in Visual Studio 2005. This program will display a simple manikin containing a text box where you can enter your name and a button that, when clicked, displays a personalized greeting in a message box.You will use the Visual Designer to create your user interface by placing binds on a form inspect the code generated by Visual Studio 2005 use the Visual Designer to change the restrainer properties use the Visual Designer to size the form write the code to suffice to a button click and run your first Windows program. Create a Windows project in V isual Studio 2005 1. On the File menu, point to New, and then click Project. The New Project dialog box opens. 2. In the Project Types pane, click Visual C. 14 SREEKANTH C STEP BY STEP 3. In the Templates pane, click the Windows Application icon. . Ensure that the Location field refers to your My DocumentsVisual CSharp Step by StepChapter 1 folder. 5. In the Name field, type WinFormHello. 6. In the Solutions field, ensure that Create new Solution is selected. This action creates a new solution for guardianship the Windows application. The alternative, Add to Solution, will add the project to the TextHello solution. 7. dog OK. Visual Studio 2005 closes your current application (prompting you to save it first of necessary) and creates and displays an empty Windows form in the Design View window.In the following exercise, youll use the Visual Designer to add three go overs to the Windows form and examine some of the C code automatically generated by Visual Studio 2005 to follow thr ough these controls. Create the user interface 1. maunder the Toolbox tab that appears to the left of the form in the Design View. The Toolbox appears, uncomplete(p)ly obscuring the form and displaying the various components and controls that you can place on a Windows form. 2. In the Toolbox, click the + sign by Common Controls to display a list of controls that are used by most Windows Forms applications. 15 SREEKANTHC STEP BY STEP 3. Click Label, and then click the visible part of the form. A Label control is added to the form, and the Toolbox disappears from view. TIP If you want the Toolbox to remain visible but not hide any part of the form, click the Auto traverse button to the right in Toolbox title bar (it looks like a pin). The Toolbox appears permanently on the left side of the Visual Studio 2005 window, and the Design View shrinks to accommodate it. (You might lose a lot of space if you have a low-resolution screen. ) Clicking the Auto wrap up button once more cause s the Toolbox to disappear again. 4.The Label control on the form is probably not exactly where you want it. You can click and heave the controls you have added to a form to reposition them. Using this technique, move the Label control so that it is positioned towards the upper-left corner of the form. (The exact attitude is not critical for this application. ) 5. On the View menu, click Properties Window. The Properties window appears on the right side of the screen. The Properties window allows you to set the properties for items in a project. It is context sensitive, in that it displays the properties for the currently selected item.If you click anywhere on the form displayed in the Design View, you will see that the Properties windows displays the properties for the form itself. If you click the Label control, the window displays the properties for the label instead. 6. Click the Label control on the form. In the Properties window, locate the Text position, change it from lab el1 to Enter your name, and then press Enter. On the form, the labels text changes to Enter Your Name. TIP By default, the properties are displayed in categories. If you prefer to display the properties in alphabetical order, click the Alphabetical button that appears above the properties list. . boasting the Toolbox again. Click TextBox, and then click the form. A TextBox control is added to the form. shine the TextBox control so that it is directly underneath the Label control. TIP When you drag a control on a form, alignment handles appear automatically when the control becomes aligned vertically or horizontally with other controls. This give you a quick visual cue for making sure that controls are lined up neatly. 8. While the TextBox control is selected, locate the Text dimension in the Properties window, type here, and then press Enter. On the form, the word here appears in the text box. 9.In the Properties window, find the (Name) berth. Visual Studio 2005 gives controls a nd forms default names, which, although they are a good starting point, are not always very meaningful. Change the name of the TextBox control to userName. 16 SREEKANTH C STEP BY STEP NOTE We will talk more about naming conventions for controls and variables in Chapter 2, rangeing with Variables, Operators, and Expressions. 10. Display the Toolbox again, click Button, and then click the form. Drag the Button control to the right of the TextBox control on the form so that it is aligned horizontally with the text box. 11.Using the Properties window, change the Text property of the Button control to OK. Change its (Name) property to ok. The caption on the button changes. 12. Click the Form1 form in the Design View window. notice that size handles (small squares) appear on the lower edge, the right-hand edge, and the righthand bottom corner of the form. 13. run for the mouse pointer over the resize handle. The pointer changes to a slanting double-headed arrow. 14. Hold down the lef t mouse button, and drag the pointer to resize the form. Stop dragging and release the mouse button when the spacing almost the controls is roughly exist.TIP You can resize many controls on a form by selecting the control and dragging one of the resize handles that appears in the corners of the control. measure that a form has only one resize handle, whereas most controls have four (one on each corner). On a form, any resize handles other than the one in the lower-right corner would be superfluous. Also strain that some controls, such as Label controls, are automatically size based on their contents and cannot be resized by dragging them. The form should now look similar to the one in the following graphic. 1. In the Solution Explorer, right-click the file Form1. s, and then click View Code. The Form1. cs source file appears in the Code and Text Editor window. There are now two tabs named Form1. cs above the Code and Text Editor/Design View window. You can click the one suffixed with Design to return to Design View window at any time. Form1. cs contains some of the code automatically generated by Visual Studio 2005. You should note the following elements 17 SREEKANTH C STEP BY STEP o using directives Visual Studio 2005 has written a number of using directives at the top of the source file (more than for the previous example). For example using System. Windows. FormsThe additional namespaces contain the classes and controls used when building graphical applicationsfor example, the TextBox, Label, and Button classes. o The namespace Visual Studio 2005 has used the name of the project as the name of the toplevel namespace namespace WinFormHello o A class Visual Studio 2005 has written a class called Form1 inside the WinForm Hello namespace namespace WinFormHello partial class Form1 NOTE For the time being, ignore the partial keyword in this class. I will describe its purpose shortly. This class implements the form you created in the Design View. Clas ses are discussed in Chapter 7. ) There does not appear to be much else in this classthere is a short bit of code known as a constructor that calls a method called InitializeComponent, but nothing else. (A constructor is a special method with the same name as the class. It is executed when the form is created and can contain code to initialize the form. Constructors are also discussed in Chapter 7. ) However, Visual Studio 2005 is transacting a sleight of hand and is hiding a few things from you, as I will now demonstrate. In a Windows Forms application, Visual Studio 2005 actually generates a potentially large amount of code.This code performs proceedings such as 18 SREEKANTH C STEP BY STEP creating and displaying the form when the application starts, and creating and positioning the various controls on the form. However, this code can change as you add controls to a form and change their properties. You are not expected to change this code (indeed, any changes you make are likel y to be overwritten the next time you edit the form in the Design View), so Visual Studio 2005 hides it from you. To display the hide code, return to the Solution Explorer, and click the Show All Files button.The bin and obj folders appear, much as they did with the Console application you developed in the first part of this chapter. However, notice that Form1. cs now has a + sign next to it. If you click this + sign, you see a file called Form1. Designer. cs, and a file called Form1. resx. Double-click the file Form1. Designer. cs to display its contents in the Code and Text Editor window. You will see the remaining code for the Form1 class in this file. C allows you to sunder the code for a class across multiple source files, as long as each part of the class is marked with the partial keyword.This file includes a sphere labelled Windows Form Designer generated code. Expanding this region by clicking the + sign reveals the code created and maintained by Visual Studio 2005 when you edit a form using the Design View window. The actual contents of this file include o The InitializeComponent method This method is mentioned in the file Form1. cs. The statements inside this method set the properties of the controls you added to the form in the Design View. (Methods are discussed in Chapter 3. ) Some of the statements in this method that correspond to the actions you performed using the Properties window are shown below .. toffee-nosed void InitializeComponent() this. label1 = new System. Windows. Forms. Label() this. userName = new System. Windows. Forms. TextBox() this. ok = new System. Windows. Forms. Button() this. label1. Text = Enter your name this. userName. Text = here this. ok. Text = OK o Three fields Visual Studio 2005 has created three fields inside the Form1 class. These fields appear near the end of the file secret System. Windows. Forms. Label label1 19 SREEKANTH C STEP BY STEP cloak-and-dagger System. Windows. Forms. TextBox userName pr ivate System. Windows. Forms. Button ok .. These fields implement the three controls you added to the form in Design View. (Fields are discussed in Chapter 7. ) It is expenditure restating that although this file is interesting to look at, you should never edit its contents yourself. Visual Studio 2005 automatically updates this file when you make changes in the Design View. Any code that you need to write yourself should be placed in the Form1. cs file. At this point you might well be wondering where the Main method is and how the form gets displayed when the application runs remember that Main defines the point at which the program starts.In the Solution Explorer, you should notice other(prenominal) source file called Program. cs. If you double-click this file the following code appears in the Code and Text Editor window namespace WinFormHello static class Program /// /// The main entry point for the application. /// STAThread static void Main() Application. EnableVisualStyle s() Application. Run(new Form1()) You can ignore most of this code. However, the key statement is Application. Run(new Form1()) This statement creates the form and displays it, whereupon the form takes over. In the following exercise, youll learn how to add code that runs when he OK button on the form is clicked. Write the code for the OK button 1. Click the Form1. csDesign tab above the Code and Text Editor window to display Form1 in the Design View. 2. sustain the mouse pointer over the OK button on the form, and then double-click the button. The Form1. cs source file appears in the Code and Text Editor window. Visual Studio 2005 has added a method called ok_Click to the Form1 class. (It has also added a statement to the InitializeComponent method in the Form1. Designer. cs file to automatically call ok_Click when the OK button is 20 SREEKANTH C STEP BY STEP clicked.It does this by using a delegate type delegates are discussed in Chapter 16, Delegates and Events. ) 3. Type the MessageBox statement shown below inside the ok_Click method. The complete method should look like this 4. private void ok_Click(object sender, System. EventArgs e) 5. 6. MessageBox. Show(Hello + userName. Text) Make sure you have typed this code exactly as shown, including the trailing semicolon. Youre now ready to run your first Windows program. Run the Windows program 1. On the Debug menu, click Start Without Debugging. Visual Studio 2005 saves your work, compiles your program, and runs it.The Windows form appears 2. Enter your name, and then click OK. A message box appears welcoming you by name. 3. Click OK in the message box. The message box closes. 4. In the Form1 window, click the Close button (the X in the upper-right corner of the form). The Form1 window closes. If you want to continue to the next chapter Keep Visual Studio 2005 running, and turn to Chapter 2. If you want to exit Visual Studio 2005 now On the File menu, click Exit. If you see a Save dialog box, click Y es to save your work. Chapter 1 Quick Reference TO Do this KeyCombination 21 SREEKANTH C STEP BY STEP Create a onsole application new On the File menu, point to New, and then click Project to open the New Project dialog box. For the project type, select Visual C. For the template, select Console Application. Select a directory for the project files in the Location box. Choose a name for the project. Click OK. Create a Windows application new On the File menu, point to New, and then click Project to open the New Project dialog box. For the project type, select Visual C. For the template, select Windows Application. Select a directory for the project files in the location box. Choose a name for the project.Click OK. Build application F6 the On the Build menu, click Build Solution. Ctrl+F5 Chapter 2 sueing with Variables, Operators, and Expressions After completing this chapter, you will be able to Understand statements, identifiers, and keywords. Use variables to store informati on. Work with early data types. Use arithmetic operators such as the plus sign (+) and the minus sign (). Increment and decrement variables. In Chapter 1, Welcome to C, you learned how to use the Microsoft Visual Studio 2005 programming environment to build and run a console program and a Windows Forms application.In this chapter, youll be introduced to the elements of Microsoft Visual C syntax and semantics, including statements, keywords, and identifiers. Youll study the primitive types that are make into the C language and the characteristics of the pass judgments that each type holds. Youll also see how to declare and use local variables (variables that exist only within a function or other small section of code), learn about the arithmetic operators that C provides, learn how to use operators to manipulate determine, and learn how to control demonstrations containing two or more operators. Understanding StatementsA statement is a command that performs an action. Statements are found inside methods. Youll learn more about methods in Chapter 3, Writing Methods and Applying Scope, but for now, think of a method as a named sequence of statements inside a class. Main, which was introduced in the previous chapter, is an example of a method. Statements in C must follow a well-defined set of rules. These rules are collectively known as syntax. (In contrast, the specification of what statements do is collectively known as semantics. ) One of the simplest and most important C syntax rules states 22 SREEKANTH C STEP BY STEP hat you must terminate all statements with a semicolon. For example, without its terminating semicolon, the following statement wont compile Console. WriteLine(Hello World) TIP C is a free format language, which means that white space, such as a space character or a new line, is not significant except as a separator. In other words, you are free to lay out your statements in any style you choose. A simple, consistent layout style makes a pr ogram easier to read and understand. The trick to programming well in any language is learning its syntax and semantics and then using the language in a natural and idiomatic way.This approach makes your programs readable and easy to modify. In the chapters throughout this book, youll see examples of the most important C statements. Using Identifiers Identifiers are the names you use to identify the elements in your programs. In C, you must adhere to the following syntax rules when choosing identifiers You can use only letters (uppercase and lowercase), digits, and underscore characters. An identifier must start with a letter (an underscore is considered a letter). For example, result, _score, footballTeam, and plan9 are all valid identifiers, whereas result%, footballTeam$, and 9plan are not.IMPORTANT C is a case-sensitive language footballTeam and FootballTeam are not the same identifier. Identifying Keywords The C language reserves 77 identifiers for its own use, and you shoul d not reuse these identifiers for your own purposes. These identifiers are called keywords, and each has a particular meaning. Examples of keywords are class, namespace, and using. Youll learn the meaning of most of the keywords as you go on through this book. The keywords are listed in the following table. abstract break char continue do event finally foreach in is as byte checked decimal double unmistakable fixed goto int ock base case class default else extern swim bladder if interface long 23 bool fetch const delegate enum sullen for implicit internal namespace SREEKANTH new out protect return sizeof struct true ulong using while C STEP BY STEP null override public sbyte stackalloc switch try unrestrained virtual object params readonly sealed static this typeof unsafe void operator private ref short string throw uint ushort volatile TIP In the Visual Studio 2005 Code and Text Editor window, keywords are colored blue when you type them. TIP In the Visual Studio 2005 Code a nd Text Editor window, keywords are colored blue when you type them.Using Variables A variable is a storage location that holds a value. You can think of a variable as a box holding temporary information. You must give each variable in a program a unique name. You use a variables name to refer to the value it holds. For example, if you want to store the value of the cost of an item in a store, you might create a variable simply called cost, and store the items cost in this variable. Later on, if you refer to the cost variable, the value retrieved will be the items cost that you put there earlier. Naming VariablesYou should adopt a naming convention for variables that help you avoid confusion concerning the variables you have defined. The following list contains some general recommendations Dont use underscores. Dont create identifiers that differ only by case. For example, do not create one variable named myVariable and another named MyVariable for use at the same time, because it is too easy to get them confused. NOTE Using identifiers that differ only by case can limit the ability to reuse classes in applications developed using other languages that are not case sensitive, such as Visual Basic. Start the name with a lowercase letter.In a multiword identifier, start the second and each subsequent word with an uppercase letter. (This is called camelCase notation. ) Dont use Magyar notation. (Microsoft Visual C++ developers reading this book are probably familiar with Hungarian notation. If you dont know what Hungarian notation is, dont worry about it ) 24 SREEKANTH C STEP BY STEP IMPORTANT You should treat the first two recommendations as supreme because they relate to Common Language Specification (CLS) compliance. If you want to write programs that can interoperate with other languages, such as Microsoft Visual Basic .NET, you need to abide by with these recommendations. For example, score, footballTeam, _score, and FootballTeam are all valid variabl e names, but only the first two are recommended. Declaring Variables Remember that variables are like boxes in retention that can hold a value. C has many different types of values that it can store and processwhole numbers, floating-point poesy, and strings of characters, to name three. When you declare a variable, you must specify what type of data it will hold. NOTE Microsoft Visual Basic programmers should note that C does not allow implicit declarations.You must pellucidly declare all variables before you can use them if you want your code to compile. You declare the type and name of a variable in a declaration statement. For example, the following statement declares that the variable named age holds int (integer) values. As always, the statement must be terminated with a semi-colon. int age The variable type int is the name of one of the primitive C typesinteger which is a whole number. (Youll learn about several primitive data types after in this chapter. ) After youve dec lared your variable, you can assign it a value. The following statement assigns age the value 42.Again, youll see that the semicolon is required. age = 42 The make up sign (=) is the assignment operator, which assigns the value on its right to the variable on its left. After this assignment, the age variable can be used in your code to refer to the value it holds. The next statement writes the value of the age variable, 42, to the console Console. WriteLine(age) TIP If you leave the mouse pointer over a variable in the Visual Studio 2005 Code and Text Editor window, a ToolTip appears telling you the type of the variable. Working with Primitive information Types C has a number of built-in types called primitive data types.The following table lists the most commonly used primitive data types in C, and the ranges of values that you can store in them. 25 SREEKANTH C STEP BY STEP Data type int Description Size (bits) * turn over Sample usage Whole poem 32 int count count = 42 long Who le numbers (bigger range) 64 float Floating-point numbers 32 231 through 2311 263 through 2631 3. 4 ? 1038 double Double accurate) numbers decimal Monetary values 128 string Sequence of characters 16 bits per not applicable character char Single character 16 bool Boolean 8 precision (more 64 floating-point 1. 7 ? 10308 28 significant igures long wait wait = 42L float away away = 0. 42F double disturbance trouble = 0. 42 decimal coin coin = 0. 42M string vest vest = 42 char grill grill = 4 0 through 216 1 bool teeth true or false teeth false = *The value of 216 is 32,768 the value of 231 is 2,147,483,648 and the value of 263 is 9,223,372,036,854,775,808. Unassigned Local Variables When you declare a variable, it contains a random value until you assign a value to it. This manner was a rich source of bugs in C and C++ programs that created a variable and used it as a source of information before giving it a value.C does not allow you to use an unassigned variable. You must assign a value to a variable before you can use it, otherwise your program will not compile. This requirement is called the distinct Assignment Rule. For example, the following statements will generate a compile-time error because age is unassigned int age Console. WriteLine(age) // compile time error Displaying Primitive Data Type Values In the following exercise, youll use a C program named PrimitiveDataTypes to demonstrate how several primitive data types work. Display primitive data type values 26SREEKANTH C STEP BY STEP 1. Start Visual Studio 2005. 2. On the File menu, point to Open, and then click Project/Solution. The Open Project dialog box appears. 3. Move to the Microsoft PressVisual CSharp Step by StepChapter 2PrimitiveDataTypes folder in your My Documents folder. Select the file PrimitiveDataTypes. sln and then click Open. The solution loads, and the PrimitiveDataTypes project. Solution Explorer displays the solution and NOTE Solution file names have the . sln suffix, such as Pr imitiveDataTypes. sln. A solution can contain one or more projects.Project files have the . csproj suffix. If you open a project rather than a solution, Visual Studio 2005 will automatically create a new solution file for it. If you build the solution, Visual Studio 2005 automatically saves any updated or new files, and you will be prompted to provide a name and location for the new solution file. 4. On the Debug menu, click Start Without Debugging. The following application window appears 5. In the Choose A Data type list, click the string type. The value 42 appears in the Sample value box. 6. Click the int type in the list.The value to do appears in the Sample value box, indicating that the statements to display an int value still need to be written. 27 SREEKANTH C STEP BY STEP 7. Click each data type in the list. Confirm that the code for the double and bool types also needs to be completed. 8. Click Quit closing the window and stopping the program. Control returns to the Visual Studio 2005 programming environment. Use primitive data types in code 1. Right-click the Form1. cs file in the Solution Explorer and then click View Code. The Code and Text Editor window opens displaying the Form1. cs file. 2.In the Code and Text Editor window, find the show Float Value method listed here private void showFloatValue() float var var = 0. 42F value. Text = 0. 42F TIP To locate an item in your project, point to happen And Replace on the Edit menu and click Quick Find. A dialog box opens asking what you want to search for. Type the name of the item youre tone for, and then click Find Next. By default, the search is not case-sensitive. If you want to perform a case-sensitive search, click the + button next to the Find Options label to display additional options, and check the Match Case check box.If you have time, you can experiment with the other options as well. You can also press Ctrl+F (press the Control key, and then press F) to display the Quick Find dialog box rather then usin g the Edit menu. Similarly, you can press Ctrl+H to display the Quick Find and Replace dialog box. The showFloatValue method runs when you click the float type in the list box. This method contains three statements The first statement declares a variable named var of type float. The second statement assigns var the value 0. 42F. (The F is a type suffix specifying that 0. 2 should be treated as a float value. If you forget the F, the value 0. 42 will be treated as a double, and your program will not compile because you cannot assign a value of one type to a variable of a different type in this way. ) The third statement displays the value of this variable in the value TextBox on the form. This statement requires a little bit of your attention. The way in which you display an item in a TextBox is to set its Text property. You did this at 28 SREEKANTH C STEP BY STEP design time in Chapter 1 using the Properties window. This statement shows ou how to perform the same t ask programmatically, using the expression value. Text. The data that you put in the Text property must be a string (a sequence of characters), and not a number. If you try and assign a number to the Text property your program will not compile. For this reason, the statement simply displays the text 0. 42F in the TextBox (anything in double-quotes is text, otherwise known as a string). In a real-world application, you would add statements that convert the value of the variable var into a string and then put this into the Text property, but you need to know a little bit more about C and the .NET Framework before we can do that (we will cover data type conversions in Chapter 11, Understanding Parameter Arrays, and Chapter 19, Operator Overloading). 3. In the Code and Text Editor window, locate the showIntValue method listed here private void showIntValue() value. Text = to do The showIntValue method is called when you click the int type in the list box. TIP Another way to find a met hod in the Code and Text Editor window is to click the Members list that appears above the window, to the right. This window displays a list of all the methods (and other items).You can click the name of a member, and you will be taken directly to it in the Code and Text Editor window. 4. Type the following two statements at the start of the showIntValue method, after the open curly brace int var var = 42 The showIntValue method should now look like this private void showIntValue() int var var = 42 value. Text = to do 5. On the Build menu, click Build Solution. a. The build will display some warnings, but no errors. You can ignore the warnings for now. 6. In the original statement, change the string to do to 42. b. The method should now look exactly like this 9 SREEKANTH C STEP BY STEP c. private void showIntValue() d. i. int var ii. var = 42 iii. value. Text = 42 e. 7. On the Debug menu, click Start Without Debugging. f. The form appears again. g. TIP If you have edited the sou rce code since the last build, the Start Without Debugging command automatically rebuilds the program before starting the application. 8. Select the int type in the list box. Confirm that the value 42 is displayed in the Sample value text box. 9. Click Quit to close the window and stop the program. 10. In the Code and Text Editor window, find the showDoubleValue method. 1. Edit the showDoubleValue method exactly as follows private void showDoubleValue() double var var = 0. 42 value. Text = 0. 42 12. In the Code and Text Editor window, locate the showBoolValue method. 13. Edit the showBoolValue method exactly as follows private void showBoolValue() bool var var = false value. Text = false 14. On the Debug menu, click Start Without Debugging. The form appears. 15. In the list, select the int, double, and bool types. In each case, verify that the correct value is displayed in the Sample value text box. 16. Click Quit to stop the program.Using Arithmetic Operators C supports the reg ular arithmetic operations you learned in your childhood the plus sign (+) for addition, the minus sign () for subtraction, the asterisk (*) for multiplication, and the forward slash (/) for division. These symbols (+, , *, and /) are called operators as they operate on values to create new values. In the following 30 SREEKANTH C STEP BY STEP example, the variable moneyPaidToConsultant ends up holding the product of 750 (the daily rate) and 20 (the number of days the advisor was employed) long moneyPaidToConsultant oneyPaidToConsultant = 750 * 20 NOTE The values that an operator operates on are called operands. In the expression 750 * 20, the * is the operator, and 750 and 20 are the operands. Determining an Operators Values Not all operators are applicable to all data types, so whether you can use an operator on a value depends on the values type. For example, you can use all the arithmetic operators on values of type char, int, long, float, double, or decimal. However, with one ex ception, you cant use the arithmetic operators on values of type string or bool.So the following statement is not allowed because the string type does not support the minus operator (subtracting one string from another would be meaningless) // compile time error Console. WriteLine(Gillingham Manchester City) The exception is that the + operator can be used to concatenate string values. The following statement writes 431 (not 44) to the console Console. WriteLine(43 + 1) TIP You can use the method Int32. dissect to convert a string value to an integer if you need to perform arithmetic computations on values held as strings.You should also be sure that the type of the result of an arithmetic operation depends on the type of the operands used. For example, the value of the expression 5. 0 / 2. 0 is 2. 5 the type of both operands is double (in C, literal numbers with decimal points are always double, not float, in order to maintain as much accuracy as possible), and so the type of th e result is also double. However, the value of the expression 5 / 2 is 2. In this case, the type of both operands is int, and so the type of the result is also int. C always rounds values down in parcel like this.The situation gets a little more complicated if you assortment the types of the operands. For example, the expression 5 / 2. 0 consists of an int and a double. The C compiler detects the mismatch and generates code that converts the int into a double before performing the operation. The result of the operation is therefore a double (2. 5). However, although this works, it is considered poor practice to mix types in this way. C also supports one less-familiar arithmetic operator the rest, or modulus, operator, which is correspond by the percent symbol (%). The result of x % y is the remainder after dividing x by y.For example, 9 % 2 is 1 since 9 divided by 2 is 8, remainder 1. NOTE In C and C++, you cant use the % operator on floating-point values, but you can use it in C. Examining Arithmetic Operators 31 SREEKANTH C STEP BY STEP The following exercise demonstrates how to use the arithmetic operators on int values using a previously written C program named MathsOperators. Work with arithmetic operators 1. On the File menu, point to Open, and then click Project/Solution. Open the MathsOperators project, located in the Microsoft PressVisual CSharp Step by StepChapter 2MathsOperators folder in your My Documents folder. . On the Debug menu, click Start Without Debugging. A form appears on the screen. 3. Type 54 in the left operand text box. 4. Type 13 in the right operand text box. You can now apply any of the operators to the values in the text boxes. 5. Click the Subtraction option, and then click Calculate. The text in the Expression box changes to 54 13, and 41 appears in the Result box, as shown in the following graphic 6. Click the / segment option, and then click Calculate. The text in the Expression text box changes to 54 / 13, and the numb er 4 appears in the Result box. In real life, 54 / 13 is 4. 53846 recurring, but this is not real life this is C In C, when you divide one integer by another integer, the answer you get back is an integer, as explained earlier. 32 SREEKANTH C STEP BY STEP 7. Select the % Remainder option, and then click Calculate. The text in the Expression text box changes to 54 % 13, and the number 2 appears in the Result box. This is because the remainder after dividing 54 by 13 is 2 (54 ((54 / 13) * 13) is 2 if you do the arithmetic rounding down to an integer at each stagemy old maths master at school would be horrified to be told that (54 / 13) * 13 does not equal 54 . 8. Practice with other combinations of numbers and operators. When youre finished, click Quit. The program stops, and you return to the Visual Studio 2005 programming environment. Now take a look at the MathsOperators program code. Examine the MathsOperators program code 1. Display the Form1 form in the Design View window (clic k the Form1. csDesign tab if necessary). TIP You can quickly switch between the Design View window and the Code and Text Editor displaying the code for a form by urgent the F7 key. 2. In the View menu, point to Other Windows and then click Document dodging.The Document dodge window appears showing the names and types of the controls on the form. If you click each of the controls on the form, the name of the control is highlighted in the Document Outline window. 33 SREEKANTH C STEP BY STEP IMPORTANT Be careful not to accidentally delete or change the names of any controls on the form while viewing them in the Document Outline window. The application will no longer work if you do. 3. Click the the two TextBox controls that the user types numbers into on the form. In the Document Outline window, verify that they are named lhsOperand and rhsOperand.When the form runs, the Text property of each of these controls holds (as strings) the numeral values you enter. 4. Towards the bottom o f the form, verify that the TextBox control used to display the expression being evaluated is named expression, and that the TextBox control used to display the result of the calculation is named result. At runtime, setting the Text property of a TextBox control to a string value causes that value to be displayed. 5. Close the Document Outline window. 6. Press F7 to display the Form1. cs source file in the Code and Text Editor window. 7.In the Code and Text Editor window, locate the subtractValues method private void subtractValues() int lhs = int. Parse(lhsOperand. Text) int rhs = int. Parse(rhsOperand. Text) int outcome outcome = lhs rhs expression. Text = lhsOperand. Text + + rhsOperand. Text result. Text = outcome. ToString() The first statement in this method declares an int variable called lhs and initializes it to the result of the explicit conversion of the lhsOperand. Text property to an int. (The Text property of a TextBox is a string, and must be converted to an int eger before you can store it in an int. This is what the int.Parse method does) The second statement declares an int variable called rhs and initializes it to the result of the explicit conversion of the rhsOperand. Text property to an int. The third statement declares an int variable called outcome. The quarter statement subtracts the value of the rhs variable from the value of the lhs variable, and the result is assigned to outcome. The ordinal statement concatenates three strings (using the + operator) and assigns the result to the expression. Text property. The sixth statement converts the int value of outcome to a string by using the ToString method, and assigns the string to the result.Text property. 34 SREEKANTH C STEP BY STEP The Text office and the ToString Method I mentioned earlier that TextBox controls displayed on a form have a Text property that allows you to access the displayed contents. For example, the expression result. Text refers to the contents of the result text box on the form. Text boxes also have many other properties, such as the location and size of the text box on the form. You will learn more about properties in Chapter 14, Implementing Properties to Access Attributes. Every class has a ToString method.The purpose of ToString is to convert an object into its string representation. In the previous example, the ToString method of the integer object, outcome, is used to convert the integer value of outcome into the equivalent string value. This conversion is necessary because the value is displayed in the Text property of the result fieldthe Text property can only contain strings. When you Controlling antecedency Precedence governs the order in which an expressions operators are evaluated. Consider the following expression, which uses the + and * operators 2+3*4This expression is potentially ambiguous does 3 bind to the + operator on its le

Monday, January 14, 2019

Wage Determination in Perfect and Imperfect Markets

Wage determination in perfect and infirm markets Perfect disputation In perfect fag out markets, e actuallyone is salary busyr both(prenominal) the make use ofee and the employer. On the one hand, the employer and his firm cannot control the market as there atomic number 18 too numerous firms and the firm is price taker on the convergence market and labor market. On the another(prenominal) hand, the proles cannot control their lock as they have no economic power to do so or they atomic number 18 of a clearly definite type.In perfect competition there is a free movement of labor. Everyone can enter the labor market or to switch jobs. Moreover, both nameers and employers have enough schooling on the labor market state engages, pack, productive take aim of workers and so forthtera The most common thinking in labor markets is that all workers in the same position are constitutely There are dickens driving forces concerning the supply of hours by an individual work er while working, the worker makes its leisure time and the work may be unpleasant.The worker experiences borderline disutility of work, which tends to append as work hours increase. To deal with the borderline disutility of work, a remuneration could be raised. This would lead to people willing to work more than hours in order to have a greater income and they are ready to sacrifice their leisure time or in other words the alternate effect appears. Still, with exalteder(prenominal) wages people tend to work less(prenominal) in order to have more leisure, which is the income effect and as a result we meet the backward-bending supply curve of labor.What determines wage rates in perfect competition is the number of qualified people, the wages and non-wage benefits in secondary jobs and the non-wage benefits or costs of the jobs. The wage of a worker is measured by the interaction of demand and supply in the labor market. A very useful tool for calculating the wage rate is th e fringy productivity theory. As long as firms are concerned, they will submit to maximize profit by employing workers until the marginal cost of employing a worker is equal to the marginal revenue the workers output earns for the firm.In other words, the wage should be equal to the marginal cost the firm has occurred by employing the last worker. According to time some differentiations might be made. In the short run expanding industries will be able to pay higher than contracting industries. In the long run there are wage differentials because workers have different abilities and they are not perfectly mobile. In conclusion, the hapless paid will be those whose labor is in low demand or high supply, they possess few skills or are unfit, work in contracting industries, do not want to move from the champaign etc.Highly paid are workers whose labor is in high demand or low supply, they have certain skills or talents or work in expanding industries. Wage determination in liberal markets In the real world, firms or workers, or both, usually have the power to order wage rates. This is the case with monopsony this is a market with a single purchaser or employer. Another option to determine prices is when the workers are array of a labor totality, which can be a monopolist or part of an oligopoly. Monopsonist are wage setters or wage makers as they are cook up all the workplaces.What is interesting about monopsonist is that if a firm wants to hire more workers, it has to pay a higher wage rate to attract workers out-of-door from other industries. The wage it pays is the average cost to the firm of employing labor and the marginal cost of hiring one more worker will be preceding(prenominal) the wage rate. To maximize profit, a monopson equalizes marginal cost of employing labor with marginal revenue product. Union monopoly or oligopoly has market power and can ascertain wages. The scope of this power figures on the market concerned.However, the higher the wages, the less the workplaces. Moreover, out of work might undercut the union wage by forcing the firm to employ non-unionised labor. The only way to increase wages and not reduce the level of employment is by increasing the productivity of labor. Another form of imperfect labor market Is bilateral monopoly. It means that a union monopoly faces a monopsony employer. In this case the wage rate and the level of employment depend on the relative bargaining strengths and skills of unions and managers.As a matter of fact, my approach a single powerful employer it might be easier for the union to increase wage rates. In bilateral monopoly the union can threaten the assiduity with strikes and consequently economic losses which gives unions more power. It often happens both sides union and management, to gain from the carried negotiations. This is called collective bargaining. In this form of agreement there are various threats or promises made by both sides. Examples of union thre ats are picketing, working to rule and such of employers can be lock-outs, plant closures etc.The government can also influence the collective bargaining. It can try to set an example, or set up arbitration or atonement machinery. Another possibility is to use leglislation, e. g. set a minimum wage rate or prevent discrimination. To change the perspective, a higher wage might also be profitable for the firms. The reason behind this lies in the fact that productivity rises with wage rates. Moreover, by investing in educational activity of the personnel, a firm will meet significant loss in the absence of the better-trained workers.High wage rates motivate workers as well. other imperfections of labor markets can be the inadequate information workers or employers receive. In addition, wages may respond very slowly to change in demand and supply, causing disequilibrium in labor markets. The last factor in determining wages we are going to examine is discrimination. It might take ma ny forms race, sex, age, class etc. In economics, discrimination means that workers of uniform ability are paid different because of the aforementioned characteristics.

Thursday, January 10, 2019

Dilemma of International Community

The US checkion strategies against foreign terrorist act go for come a big way since the mid-1990s. The disciplined, centralized organization that conducted the family line 11 is diminished beca mathematical function virtually of the multitudes senior and midlevel leaders atomic consider 18 either incarcerated or dead, while the bulk of those still at large atomic number 18 on the run and focused at least as much on survival as on sickening operations. However, Al infrastructure still has the capableness to impose lethal curse.From the critical stand sign, the refer ch completelyenges for contemporary counter act of terrorist act efforts are non as much Al Qaeda or any other terrorist organizations as what pull up stakes follow them. The emerging primary terrorist threat includes the global network of mostly Sunni Moslem extremists, which extends beyond members of Al Qaeda. The foundations of these extremist sources go along very much a merry and in near case s are growing deeper. Practically, they book the interconnected economic and political systems of the Islamic world.In addition to Islamic factor, in that lo retchion is a round-eyedspread opposition to struggled U. S. policies within and toward the Muslim world, especially the U. S. political position on the Israeli-Palestinian conflict and, which is more important, the invasion and concern of Iraq (Byman, 200361). Considering the menti wizardd trends and reasons, the counterterrorism gainsays after the liquidation of Al Qaeda may very well be tied(p) more complex than they were before.Decentralization and near nature of terrorist plots as well as indeterminate nature of the final stigma imposes extreme challenges on the intelligence. While the guardianship of intelligence in counterterrorism is to monitor and pr veritable(a)t terrorist activity, practically it may become unprofitable due to its in energy to identify terrorist groups and individuals. However, even a dec entralized terrorist threat has some connections that fecal matter be discoered, and this lead make water the core of intelligence counterterrorist efforts.From the practical standpoint, although around all(prenominal) extremist can be connected at least indirectly to the network of Sunni Islamic terrorists, the majority of linkages includes precisely casual contacts and do not bring preparations for terrorist operations directed against the unify States. No intelligence service possesses the elections to monitor all of these linkages, to construct the support history of every terrorist, or to compile comprehensive sociograms of the home Islamist video (Rothkopf, 200534). foreign corporations willingness to financial aid in the struggle against terrorist organizations to the major point in metre has depended on Al Qaedas record and menacing capabilities. However, from the contemporary point of view, contrary cooperation becomes more problematic as the issue moves b eyond Al Qaeda. Menti mavend difficulties that the get together States has already encountered in dealing with Lebanese al-Jihad depict some of the problems in more generally enlisting foreign help against terrorist groups (Byman, 200363).An underlying limitation to the willingness of foreign community to collaborate with the United States on antiterrorist efforts is the skepticism among foreign political elite that the most index numberful country in the world needs to be preoccupied with smooth groups of radicals. Critically, the skepticism of foreign community can be considered in terms of fact that the U. S. preoccupation is no seven-day with the group that carried out the terrorist good times on folk 11 (Nash, 200456). However, the most significant challenge to the U. S.counterterrorist efforts that may emerge along with a more decentralized terrorist threat is the ability to uphold the nations induce commitment to struggle it. Surprisingly, the American golf club h as revealed that its determination to fight counterterrorism can be just as inconstant as that of foreign unrestricteds. During the past quarter century, the U. S. public and organisation has given different and contradictive attention, priority, and resources to U. S. counterterrorist programs, with touch on and efforts increasing in the aftermath of a major terrorist misadventure and declining as time passes without an attack.International Threats of terrorist act From the critical standpoint, it is clear that even being the worlds l sensationsome(prenominal) superpower the United States can no longer sustain a war on terrorism. Due to inability of the US to provide detection, monitoring and elimination of degree centigrade percent of transnational terrorist groups, world(prenominal) cooperation in this area seems to be a lustrous solution. Moreover, terrorist organizations are now acting crosswise the domestic borders of hosting states, jeopardizing certification of e ntire international community and upstart terrorist acts in capital of the United Kingdoms subway became an evident contribute for this statement.Brian Jenkins underlines that the success of terrorism has much to do with the perception of a nations capability to deal with such crises, proposing that public perceptions of government standing and competence in combatting terrorism are based not on overall performance, but kinda on performance in a few dramatic hostage incidents, where the government, of course, suffers disadvantages from the opening ((Jenkins, 198310). Indeed, the public sees the government altogether in crisis, demonstrably unable to provide security for its citizens, sometimes yielding to terrorists to save cognizes, unable to bring its enemies to justice.Practically, a rescue test or successful prevention of an attack adds immeasurably to a nations image of multitude prowess, while an travail that fails does incalculable damage. Many statistics exist to mensurate the activities, total, typecasts, locations and targets of international terrorists. It was inform in 1986 that incidents of terrorism those involving citizens or territory of more than unrivalled country declare doubled in number since 1975, to slightly over 800 defy year 1985 (Hanley, 19863).Notwithstanding the bomb calorimeterings in rarefied 1998 in Kenya and Tanzania, at that place are analysts who believe terrorism has been in decline in fresh years. Patterns of international Terrorism 1997, published by the American State subdivision, reported that on that point were a total of 304 acts of international terrorism, one of the lowest annual totals since 1971 (US De fall inment of State, 1997). match to Patterns of orbiculate Terrorism 1998, the number of acts of international terrorism dropped to 273 attacks. However, in 1998 there was a record high toll of 741 masses killed and 5,952 injured in terrorist attacks (US segment of State, 1998).In 2000, there were 423 terrorist acts, an amplification of eight percent from the 392 attacks in 1999. The death toll for 2000 was 405, and 791 were wounded (US Department of State, 1999, 2000). The year 2001 witnessed a dramatic increase due to the audacious attacks on 11 September of that year. Many commentators agree that terrorist delirium is, and will samely remain, an integral part of international relations. As Scotland Yards counterterrorist specialist George Churchill-Coleman stated, Terrorism is with us now, whether you like it or not. Youve got to adjust your way of life to that (Hanley, 19863).This mentality has now reached the American scene as the head of the Office of homeland Security, Tom Ridge, renowned, We need to accept that the accident of terrorism is a permanent sort out for the foreseeable future. He stated, We just fuck off to accept it (Calabresi & Ratnesar, 21). At airports there is a get on with the ad hominem credit line attitude and in daily surv iving one moldiness accept the need to be on guard, like direction clear of suspicious packages and reporting them to the local police. One columnist wrote, By not surrounding the (terrorist) incident with hysterical posturing, we extirpation it down to size.We make it seem a nuisance rather than a cataclysm. We wash its capacity to instill terror. We decline to be afraid (McCabe, 1996a4). In that regard, Great Britain is one of the few nations which is intimately familiar with terrorism and its impact. Lacking any other alternative, the British possess es directially learned to live with the threats and the barrage fires. Moreover, the British have learned to live with intrusive surveillance cameras, the cost of bomb insurance (3. 2 billion dollars a year), as well as a higher awareness of the threat that has been assimilated into the union over the years, particularly since the late 1960s.Even disdain the recent terrorist attacks in Londons subway, the British approach to terrorism, bugger offed over many years, seems natural in a culture that places great store on a stiff upper backtalk (McCabe, 1996b8). The prognosis becomes ever more affright as terrorists seek out softer targets, as witnessed in the 1998 bombings of the American embassies in Kenya and Tanzania. This is because international police and security agencies will, for the most part, spike the defenses of consulates, embassies and residences, and will provide other forms of personal security for the more likely terrorist targets.Therefore, terrorist attacks will probably become more indiscriminate. The bombing campaigns in Paris during the summers of 1986 and 1995, aimed at government buildings, restaurants and cafes, the bombings in London during the spring of 1992 of commuter train stations and the financial district, and the use of gigabyte in the subway in Japan by the Aum Shinrikyo in 1995, and the February 2001 reported discovery by the British police of a terrorist plot to release sarin into the London underground system as well as the suicide seize of four airliners in September 2001 are examples of what we may expect.(Other examples of indiscriminate terrorism are the run intos at airports such as those in December 1985, in Rome and Vienna. ) Furthermore, targets be in passing developed change societies and analysts anticipate that terrorist groups will begin targeting critical points such as computer systems, power grids and other key links of industrial societies (Hanley, 1986b2). Reports underline that terrorists are expanding their interests in thermonuclear, chemical, and biological weapons as well as instruction war furthere.Some of these concerns were highlighted in December 1999 when the Solicitor oecumenical of evokeada, Lawrence MacAulay, told the House of Commons that Canada needed to corroborate the governments capacity to place the threat of a nuclear, biological or chemical attack by terrorists. Although the misfortune of such an attack happening was low, Mr. MacAulay felt all levels of government must be prepared to deal with such eventualities (Evenson, 20012).His concerns followed warnings by scientists of the Health Protection Branch that a release of the deadly anthrax bacterium in a major Canadian population center could kill upwards of 35,000 and cost 6. 5 billion to the wellness care system, underlining the fact that medical facilities were not prepared to deal with such an incident (Evenson, 20012). In the fall of 2001, a serial publication of letters containing the anthrax virus were send out to media centers in New York City.The letters were sent to ABC, NBC and CBS, and were orchestrated to attain the maximum gist of media coverage, while concomitantly stirring up fashionable fear and anxiety about these and other thinkable attacks. Another issue that relates to this is that of nuclear scientists who represent a valuable resource to those nations developing nuclear programs, such a s modern Iran. Potential Responses to Terrorism International Scope The evolution and deployment in the mid-seventies of elite counterterrorist teams in Israel and West Germany was in response, partly, to the frustrations of employing a series of so-called non-force methods against terrorists.Livingstone has argued that governments have use a variety of nonforce strategies in their efforts to resist terrorism, including diplomacy, negotiation, concessions, and cooptation. Occasionally such methods have worked, but more often than not they have failed or only provided a temporary prophylaxis to an endemic problem (Livingstone, 1982176). now it is widely recognized that, under most circumstances, making concessions to terrorists only invites further acts of terrorism. This fact, combine with the failure of the U. N.to take concerted fulfill to develop effective remedies to the problem of international terrorism, has resulted in a growing style on the part of national governments to indemnify to unilateral military action against terrorism in the belief that, if it is not possible to make terrorists answerable to the law, then they must be answerable to the gun. It is apparent from recent twentieth-century history in Western countries that the indebtedness for combating terrorism has been, for the most part, that of law enforcement authorities.On occasion, armament units were tasked and, for the most part, were found to be operationally wanting in a number of areas such as strategy, methodology and structure. formal military forces and tactical manoeuvre have not met the challenge of terrorism Not only are contemporary weapons and tactical maneuver far too destructive to be employed in heavily populated urban regions, but also the deployment of large numbers of soldiers against terrorists simply increases the number of targets at which they can strike (Livingstone, 1982176).General George Grivas, the famous Cypriot terrorist leader, noted that the lev el of terrorist operations is much lour than that of conventional military operations. Counterterrorist operations posit specially adapted and expert soldiers, tactics and strategy. He noted the only entrust of finding us was to play cat and mouse to use tiny, expertly trained groups, who could work with art and patience and strike rapidly when we least expected (Taber, 1977118).In short, one must use those same weapons and tactics belonging to the terrorists inventory psychology, stealth, speed, surprise and cunning against the terrorists themselves. Moreover, candidates for such units must have demand and determination, physical and mental stamina, initiative and self-discipline, be capable of operating in small groups during long-term isolated operations, and they must have the aptitude to assimilate a wide range of skills and think laterally. This type of military operation demands a different type of soldier, namely one who can develop a broad spectrum of skills.Practic ally, contemporary counterterrorism demands highly trained and motivated commandos, operating in small groups skilled in electronics, communications, demolitions, marksmanship, deception, dense killing and familiar with terrorist tactics and behavior. References Byman, Daniel (2003). Should Hizballah Be Next? Foreign personal matters 82, no. 6, November/December 54-66. Calabresi, Massimo, & Romesh Ratnesar (2002). Can We Stop the Next Attack? Time, 11 March, 1626 Evenson, Brad (2001). Canada bad Prepared for Germ warfare. National Post, 1 FebruaryHanley, Charles (1986a). Experts Note Common Traits in Terrorists. capital of Canada Citizen, 19 April Hanley, Charles (1986b). International Terrorism Global Order Shaken by play War. Ottawa Citizen, 19 April Jenkins, Brian Michael (1983). New Modes of Conflict. Santa Monica, atomic number 20 Rand Corporation, June. Livingstone, Neil C (1982). The War against Terrorism. Lexington, Massachusetts Lexington Books McCabe, Aileen (1 996). Britain Learns to go with Terrorism after Decades of Blasts. Ottawa Citizen, 4 August McCabe, Aileen (1996).Facing Terror with a Stiff Upper Lip. Montreal Gazette, 3 August Nash, James L (2004). Prevention or cure. Organisation for Economic Cooperation and Development. The OECD Observer. Paris may56 Rothkopf, David (2005). Can Technology bank U. S. Intelligence. Technology Review. Cambridge Feb. 108(2) Taber, Robert (1977). The War of the Flea Guerrilla Warfare Theory and Practice. St. Albans, Frogmore, Herts, Great Britain Paladin United States, Department of State, Patterns of Global Terrorism 1997 Retrieved From < http//www. mipt.org/Patterns-of-Global-Terrorism. asp> Accessed Jan 3, 2006 United States, Department of State, Patterns of Global Terrorism 1997 Retrieved From < http//www. mipt. org/Patterns-of-Global-Terrorism. asp> Accessed Jan 3, 2006 United States, Department of State, Patterns of Global Terrorism 1999 Retrieved From < http//www. mipt. org/Pa tterns-of-Global-Terrorism. asp> Accessed Jan 3, 2006 United States, Department of State, Patterns of Global Terrorism 2000 Retrieved From < http//www. mipt. org/Patterns-of-Global-Terrorism. asp> Accessed Jan 3, 2006

Monday, January 7, 2019

A Better Future with Green Technology Essay

We live in the twenty- early century which has been dealed the century of the environment. Our landed e enjoins engageing and individual citizens atomic number 18 coming to an under tie-uping that we go off non assume any yearlong that tasks such(prenominal) as pollution, climate changes and the dwindling numerate of native resources can be roll off for a in store(predicate) times to deal with ( unfledgeds investigatorhnology, 2010). in that respect ar more drills and reasons for grand engine room. However, with the use of thou applied science we can be possessed of a healthier, pristine and possibly longer future. In this news report, I result be discussing just a a few(prenominal) of those galore(postnominal) uses. The term engineering science refers to the application of k directledge for a applicatory purpose. Now the subject field of special K engineering science encompasses a ceaselessly evolving convocation of industries, industrial appli cations, methods and materials which exploit the value of the technologies that benefit the environment. This includes techniques from generating nil alone the focus to non-toxic justing products ( yard engineering, 2010). These groups particularly exploit the tr end up this technology impacts the kind condition.See more Unemployment problems and solutions essayThe group of effected industries is quite diverse. It includes businesses as farthermostaway as the fields of cogency and agriculture. thither be slightly who predict that someday every consumer product will be affected by atomic number 19 technology. The chief(prenominal) goal of parkland technology is to materialize ways to produce technology in a way that does not alter or deplete any of the domains inwrought resources. The use of green technology is enounced to reduce the join of waste and pollution that is created during production and consumption. There argon many diverse uses for green technology in our everyday lives. These different uses include a renewable energy source from alternative fuels, recycling, construct green, inbred and environmentally pally undressing supplies, green chemistry and even green nanotechnology ( car park technology, 2010). The about urgent of these issues is perhaps the use of renewable energy. The two main ways to be able to generate energy would be by exploitation solar powered panels and the other is using wind turbines. cycle is an easy way for us to table service out our future generations. Recycling helps to head off unnecessary waste in our landfills and is in addition environmentally friendly. Another good way to likewise be environmentally friendly is to buy products that have been made using recycled products and natural ingredients. The U.S. Enviromental Protection Agency defines construction green , also kn give birth as sustainable or high mathematical process building, as the lend oneself of creating structures and using processes that atomic number 18 environmentally responsible and resource-efficient by dint ofout a buildings life-cycle from siting to design, construction, operation, maintenance, renovation and deconstruction. This practice expands and complements the classical building design concerns of economy, utility, durability, and pull (Palmese, 2009). Building green encompasses every social function from the choice of building materials to where a building is located (Green Technology, 2010).The coupled States forces is trying to flash back anchor its dependency on their usage of dodo fuels. Therefore, they are crook to more greener and natural approaches to curb their dependency. The green that the phalanx is go to is definitely not the camouflage. Currently the armament and navy blue are both exploring green technology options. S archaiciers are going green with solar power units, purifying dead(prenominal) waters, solar tents and LED lights (Lowman, 2011). The sold iers is development two solar powered humvees that they call ply Alpha and FED Bravo. FED stands for Fuel Efficient Ground vehicle Demonstrator (Iliaifar, 2011). FED Bravos details are very lean and so it as yet remains more of a mystery. FED Alpha is suppose to be equipped with a solar panel that is mounted on the Humvee to be able to assist with its electrical governing bodys (Iliaifar, 2011). The U.S. military are currently using solar powered cooling tents in Afghanistan.The U.S. military has a goal to acquire 25 percent renewable energy by the year 2025. Fort Drum, NY has one of the domains largest solar installations which currently heats the perfect base (Lowman, 2011). The U.S. army and the U.S. Navy have both kicked off net zipper(a) programs which is aimed at reducing not plainly energy use on bases and also on water use and waste. The U.S. Navy is aiming for half of its bases to have net adjust energy consumption by 2020. The the States is planning to instal l rooftop solar installations in as many as 160,000 insular military home in 33 different states to help with energy cost (Westervelt, 2012). The Navy has commissioned a channelise that is energy efficient. It is called the Makin Island. It is the first amphibious trespass ship to replace its steam boilers with brag turbines. It is also the first Navy start ship to be equipped with both gas turbinesand an auxiliary propulsion system (Department of Defense, 2009)The motortrucking constancy is also continuously evolving to be be more green. Carriers are going with immaculate trucks to get give out fuel mileage and help cut out on harmful emissions. These long time there are numerous opportunities for a carrier to turn their fleet into a green fleet (Britton, 2010). California is congruous more of a green state. The state of California passed new laws to where a truck driver can not faint there truck if it is not a clean emissions truck. Now that the new clean trucks, Frei ghtliner Cascadia and the International ProStar and Lonestar, are readily acquirable it makes this easier to achieve. The trucking industry has been able to achieve well zero nitrogen oxide emissions as of January 1, 2010.It also achieved zero particulate emergence emissions as of January 1, 2007 (Britton, 2010). Now that the trucking industry has been able to cut back nearly all emissions to zero they are turning their sights on another problem. The new problem the industry is tackling is fuel consumption. One amour they have tried so far is using auxiliary power units, which are also known as APUs, when matinee idoling the truck at a rest neighborhood or truckstop has helped instead of burning a gallon of fuel an hour to idol the truck like before it now takes a gallon to idol for all ten hours since having an APU installed on the trucks. Another way the trucking industry was tried to maintain fuel to be watch greener is by transmutation to wide-based tires. This has cut c onsumption as a lot as ten percent in some cases (Britton, 2010).Freightliner has clean drive technology in all their trucks they make now. They can claim this only due to discriminating Catalytic Reduction, or SCR, and distressing Tec Emissions Technology that help their heavy concern trucks to exceed EPA standards while still organism cost efficient, practical and proven to stand the wear and tear of the industry (Freightliner). fat Tec Emissions Technology has proven to ontogenesis performance with every drop of diesel motor fuel, reduce more of the pollutants from exhaust gases, and repair profitability from every mile covered. The Blue Tec Technology treats the exhaust gases and the end results are nitrogen and water. The same thing we breathe in. The Cascadia has an aerodynamic exterior to also help reduce drag and reform on fuel efficiency.There are new developments constantly in the field of green technology. One of the new developments is a hydrogen powered car. It is a zero emission car that produces water as exhaust. Green technology is hitting our major(ip) cities. Most cities are going good and natural to preserve the Earths resources. Most larger cities have familiar transportation that run off clean fuel. Before we know it there will not be a arrangement that is not going green or already gone green. We ourselves can pop out on the green bandwagon. We can do this simply by doing a few things we already do to begin with. The first way is to come up with your own cleaning supplies from a few things around the house such as baking club soda, vinegar and even lemons. Baking soda is good to remove stains, cut through tough grease and to freshen carpets (US Green Technology,2012).With these three simple products you could clean your entire home. Vinegar and newspaper or paper towel you can clean windows, mirrors and tile. Do not throw out any old electronics. It is bettor to donate old cell phones to someone in demand or recycle them at a store that offers it. This is important because the old bombardment and possibly even the device still could contain mercury, which is extremely poisonous to the environment (U.S. Green Technology, 2012). After all the punishing earned money spent on the device to begin with, it would be better to put it to good use some how. Another way to be green is the stop drinking bottled water because it saves our satellite from having another non-biodegradable plastic bottle move around.It is better to get a filter that you place on your faucet (U.S. Green Technology, 2012). Hopefully the nations leaders and all of the individual citizens will come to understand that while we live in the century of the environment, they can no longer assume that the Earths natural resources will be there for the future generation to be able to accost the problems of pollution, climate changes and the rapidly dwindling meter of natural resources left. There are many great uses and reasons for choo sing to use green technology. The use of green technology can lead us all to a healthier, cleaner and possibly longer future.ReferencesBibb, B. (2011) Green Perspectives needed Commercial Recycling Creates Manufacturing Jobs. Green Technology. Retrieved from http//www.green-technology.org/green_technology_magazine/a-new-kind-of-corporation-in-california-for-a-new-bottom-line-q-/green-perspectives-mandatory-commercial-recycling-creates-manufa/ Britton, D. (2010, February 17) put wisely in Green Technologies. rotund Duty Trucking. Retrieved from http//www.truckinginfo.com/news-details.asp?news_id=69434 Department of Defense. (2009, October 22). Retrieved from http//www.navy.mil/search/display.asp?story_id=49147 Freightliner Trucks (2012, abut 5) Retrieved from http//www.freightlinertrucks.com/TruckInnovation/Clean-Drive-Technologies Green Technology (2010) Retrieved from http//www.green-technology.org/what.htm Green Technology (2010) Retrieved from http//www.green-technology.org/a bout.htm Iliaifar, A. (2011, December 29). Retreived from http//www.digitaltrends.com/cars/us-military-planning-to-go-green-with-hybrid-humvees/ Lowman, M. (2011, August 01) The military goes green. erudition/Technology. Retreived from http//www.newsobserver.com/2011/08/01/v-print/1381865/the-military-goes-green.html Palmese, R. (2009, June) Green Building Construction in California. Retrieved from http//www.green-technology.org/greentech-report-june09r.pdf U.S. Green Technology. (2012, January 14). How to be Green. Retrieved from http//www.usgreentechnology.com/stories/how-to-be-green/ Westervelt, A. (2012, Febuary 2). Why the military hates fossil fuels. Forbes. Retrieved from http//www.forbes.com/sites/amywestervelt/2012/02/02/why-the-military-hates-fossil- fuels-and-you-should-too-part-one-inefficiency/ Westervelt, A. (2012, February 6). The Militarys Green Tech Strategy. Forbes. Retrieved from http//www.forbes.com/sites/amywestervelt/2012/02/06/why-the-military-hates-fossil-fu els-part-two-alternatives/ Westervelt, A. (2012, February 14). How the Military uses Green Tech to Save Soldiers Lives. Forbes. Retrieved from http//www.forbes.com/sites/amywestervelt/2012/02/14/how-the-military-uses-green-tech-to-save-soldiers-lives/

Sunday, January 6, 2019

Financial Disclosure of Starbucks

account avouchment is the language of art. It is used basically to go by or to provide in nervous straination nearly the profit or loss and the fiscal position of the business nigh which on that point be many interested get goingies give c atomic number 18 owners, employees, creditors, g overnment, investors, and research scholars. To provide much(prenominal) priceless instruction an accountant prep ars monetary statements comprising of art and Profit and Loss Account and the dimension Sheet. But these statements backside non meet the needs of a wide variety of users unless they are active in a prescribed form and erupts all the material facts of the business.To comply with this method of accounting principle namely full revelation principle has been developed which postulates that the financial statements should disclose all the fundamental material facts approximately the business. In addition to this, it withal states that the heading of much(prenominal ) statements must not save be to provide true and true(p) view of the state of affairs of the business further also it must be able to give the prescribed forms nether which such financial statements are prepared. This revealing of accounting principle helps the organic law to snitch their financial statements and mail stone of the organic evolution of the business.A qualified financial statement helps to the organization to take the decision accurately. This paper discusses the disclosure principles followed by Starbucks Inc. with regard to certain accompaniments. The sample covers except important items of afoot(predicate) assets such as currency and capital equivalents, receivables and entry. The strain also discusses the various components of interchange and exchange equivalents of the association. Disclosure Policy with regard to cash and cash equivalents, Receivables and Inventory Starbucks is recognized as the worlds number 1 specialty deep brown retailer company.It has more than 16,000 coffee bean shops set at different countries which are active more than 35 countries. Their outlets offer not only coffee drinks and food items, but also roasted beans, coffee accessories, and teas. Starbucks owns more than 9,000 of its shops, which are located in close 10 countries, but most of its outlets are situated in US, while licensees and franchisees bleed more than 7,400 units worldwide and they are generally centre on shopping centers and airports. The company also owns the Seattles Best Coffee and Torrefazione Italia coffee brands.In addition to this, Starbucks markets its coffee through securities industry stores and licenses its brand for an otherwise(prenominal) food and boozing products. Starbucks as a firm has around accounting flexibility in beat their key success factors and risks. This flexibility makes them to allot its reported numbers in such a dash that it makes their accounting entropy to be informative and rel iable as regards to how their company is doing and to evaluate and analyze their movement more significantly. Starbucks, like most other companies in the United States, must tie to standard accounting policies and conventions.With all of the untested SEC regulations, companies pull in less elbow room to move around numbers in their financial statements in a way to benefit the company and it discloses the financial information more clearly and up to date. In order to assess the firms business strategy and explaining key accounting policies financial disclosure is necessary. It describes lot about the items involved in the financial statement such as cash and cash equivalents, cash receivable, inventory, allowance for doubtful accounts, property, plant life and equipment, etc.The Management Discussion and Analysis of monetary Conditions and Results of Operations section of the 10-K sufficiently explains Starbucks current exertion and Also their report describes the add in ear nings. Revenues are growing overdue to the increase of new stores opening in the United States and in other countries. This depicts canvas the StarbucksConsolidated Statements of Earnings and Liquidity and large(p) Resources. This also shows breaks down individually item and describes why each increased between the years.Operating segments are the business segments that are focused on in the 10-K. The 10-K does not contrive any bad news or hardly any poor performance that has occurred. Starbucks is a growing company and their revenues do increase each year, but it in the main shows all the increases of the statements and gives some explanation on why certain items change magnitude. change from gross revenue consists of Sales +/- the decrease/increase of Accounts Receivable. separately year, Cash provided/ (used) by changes in in operation(p) assets specifically Accounts Receivable were at a decrease.Because of this reason why the ratio is under one because Cash from Sales is greater than Sales. ThNetSales/Net Accounts Receivable ratio fluctuated end-to-end the years. Sales increased substantially each year as Accounts Receivable only increased slightly. The Net Sales/ honorary Revenue ratio consistently decreased through the years. The disclose procedure of inventory valuation with respect to Starbucks can follow through moving average cost method, last-in-first-out method, or the first-in-first-out method.All of these methods produce variant outcomes that can each benefit or maintain the financial statements of the firm. Also, every firm has a extract on how they want to amortize saving grace over the period. They can write-off the saving grace over forty years or take a more fusty approach and write it off over a shorter time period. It is also important to realize how Starbucks records their inventory on their coalesced financial statements. Since they sell products, not services, they have a large inventory, which they record at the lowe r of cost or market.It is also crucial how a firm records and depreciates its inventory, and can give investors wrong information if not done correctly. Components of Cash and Cash equivalents The components of cash and cash equivalents are stated by Starbucks as being highly legato instruments with a maturity of three months or less when purchased to be cash equivalents. The cash and cash equivalent components of star bucks Cash and cash equivalents are the most lucid assets found within the asset impute of a companys balance sheet.Cash equivalents are assets that are readily convertible into cash, such as capital market holdings, short-term governance bonds or Treasury bills, marketable securities and commercialized paper. Cash equivalents are distinguished from other enthronizations through their short-term existence they produce within 3 months whereas short-term investments are 12 months or less, and long-term investments are any investments that mature in senseless of 12 months.Another important condition a cash equivalent needs to action is that the investment should have insignificant risk of change in value, when used in the context of payments and payments transactions refer to currency, coins, money orders, paper checks, and stored value products such as gift certificates and gift cards. If in appointment of cash flow is written that investment is short term which should not convey that investment as a part of cash and cash equivalent.

Thursday, January 3, 2019

Acid and Base Report Qualitative Data

hots and Bases Labs Report push To study the characteristics of dots and bases. Experiment 1 magnesium Ribbon with Sulphuric blistering thoughtfulnesss square/ kernel Rate of reaction Bubbles initial illusion Final discolor otherwise Observations H2SO4 N/A N/A dull N/A acerbic Mg N/A N/A Silver Metallic N/A Metal Mg SO4 lofty esteem Yes- High rate Colourless Colourless Heat is produced. Acidic shade Hydrogen gas was produced. streamlet keen Splint Result Popping die boilers suit chemical reply newsworthiness equating Magnesium + Sulphuric Acid ( Magnesium Sulphate + Hydrogen Chemical Equation Mg + H2SO4 ( Mg SO4 + H2 2. atomic number 20 change with Hydrochloric Acid Observations existent/ stub Rate of reaction Bubbles sign semblance Final colour separate Observations HCL N/A N/A release N/A Acid lime water system N/A N/A Clear N/A N/A Ca CO3 N/A N/A snow-white N/A Salt Ca CO3 + HCL High rate/ ready Yes.High rate/ Mi lky, Cloudy White, Cloudy, Heat is produced. Fast overhasty formed Observation of Final ascendant Final firmness was cloudy with precipitation. Overall Chemical Equations intelligence activity atomic number 20 Carbonate + Hydrochloric Acid ( Calcium Chloride + Carbon Dioxide + Water Chemical Equation Ca2CO3 + 2HCL ( 2CaCl + CO2 + urine 3. Almost equal amounts of sodium hydroxide and nitric acid (same concentration) Observations Material/substance Rate of reaction Bubbles Initial colour Final colour Other Observations HNO3 N/A N/A N/A N/A NaOH N/A N/A N/A N/A HNO3 + indication N/A N/A Strong Pink/ rose solicit/ clear Test with PH authorship PH 1, maroon NaOH + Indicator N/A N/A Test with PH paper PH 14, shadow purpurate HNO3 + NaOH High rate/ Fast N/A Heat is produced. Observation of Final solution Final solution was cloudy with precipitation. Overall Chemical Equations raillery Calcium Carbonate + Hydrochloric Acid ( Calcium Chlori de + Carbon Dioxide + Water Chemical Equation Ca2CO3 + 2HCL ( 2CaCl + CO2 + H2O 4. Copper (II) Oxide with hydrochloric acid Observations Material/substance Rate of reaction Bubbles Initial colour Final colour Other Observations CuO N/A N/A Black N/A Black powder HCL N/A N/A colourless N/A Acid CuO + HCL Fast N/A Black cloud, opaqueTurns turquoise green, Heat is produced. clear, translucent Black CuO settles at the bottom of apparatus. Overall Chemical Reaction Word Equation Copper (II) Oxide + Hydrochloric Acid Chemical Equation CuO + 2HCL ( CuCl2 + H2O 5. ammonium ion chloride solution with sodium hydroxide Observations Material/substance Rate of reaction Bubbles Initial colour Final colour Other Observations NH4Cl N/A N/A Colourless N/A pulverize NaOH N/A N/A Silver Metallic N/A Metal NH4Cl + NaOH Test with PH paper, purple ( greater than 7, alkaline (basic) Acidic smell, briary Overall Chemical R eaction Word Equation Ammonium Chloride ( Ammonium hydroxide + Sodium Chloride Chemical Equation NH4Cl + NaOH ( NH4OH + NaCL

Tuesday, January 1, 2019

Green Mile Book Report Essay

To some people the words Book-report think of rent the celluloid and write a report on that. Yes, it is easier to watch a three-hour photo rather than drive a 536-page sacred scripture. With most def oddments turned photographs, though, the beat is uttermost too detailed to fit e actuallything. This is how it is with the entertain The greenish air mile and the movie The Green Mile. There atomic number 18 similarities besides, there argon also a lot of differences surrounded by the dickens.The main parts of the handwriting and movie ar also Coffey being caught with the devil dead girls in his arms, Coffey bear ons Hals wife and Coffey dying at the end. There atomic number 18 half-sizeer details that atomic number 18 a exchangeable and that is much important than the main parts. whizz small thing is that Paul does baffle a UTI in both the phonograph record and the movie. This is a small part but it brings a lot to the movie and the guard beca ingestion t his is how Paul finds out that Coffey is innocent. Another small thing is the placement of the pris aners in the sustain and the movie.They arent exact but they are pretty c suffer and this shows importance when the grovel, later called Mr. Jingles, walks up and down the green mile. Lastly, a small detail that is the uniform in both the hold and the movie is the nett sentence. Paul explains his punishment for killing unrivaled of Gods great miracles. This is very important because it brings the whole movie and the password to a close. Along with the similarities there are major differences and minor differences amid the earmark and the movie.The major differences that I noticed between the book and the movie are the mouse doesnt die at the end in the movie, and there is no in truth character in the nursing shoes that bugs Paul in the movie akin there was in the book. A smaller detail that is different is that in the book Paul asks Coffey to tie his shoe and Coffey kit tyt do it. This turned into a major point in the book because it went through how the dog was killed with meat and Coffey was carrying his lunch tied up, when he was found with the girls.The except way Coffey would have been able to use the meat would have been to untie the bundle his lunch was in and then bind it. In the movie this isnt withal explained which is kind of sad because it shows that he very isnt the one who killed the girls. Another compute is that in the movie everything is shortened to save m. This is because people take for grantedt unavoidableness to sit through a five-hour movie. Lastly, the movie was created by the impression the scriptwriter got with the help of Stephen queer so of course there is no way they could have the exact same ideas all the time.This is a great book and a great movie and there is no way that the movie could do by everything that the book covers because there is a time limit with movies when people start to lose interest. Ways that the differences could become less bare would be by in from each one scene add detail regular(a) if it is just one line for a character it would make the book and movie seem more alike. Instead of two people looking at the book and combining their idea it would be one idea shared by millions.Everyone says dont just a book by the cover, well with more books turning to movies I think that that utter should be modified. The aspect for nowadays would have to be Dont say a book by its movie. I am not saying that all books turn movies are bad. I am saying if you didnt like the movie and see the book picture to read it because there might be more to the story than what the movie covered. boilers suit both the movie The Green Mile and the book The Green Mile are very good stories but to consider the whole story you should both read the book and watch the movie.