Premium Essay

Prg 420 Week 3 Supporting Activity 1

In: Computers and Technology

Submitted By peacebear241
Words 273
Pages 2
There are 3 kinds of loops—for loop, while loop, and do while loop. Under which circumstances would each kind of loop be more appropriate? Explain your answers using specific examples.

For loop- The for loop is best used when the number of iterations is known. The for loop is best used to repeat the loop a fixed number of times. The Boolean-expression is tested at the beginning of the loop. The for loop has the form: for (initialization; Boolean-expression; increment) {nested statements }.
A for loop can be used to show every number divisible by 3 between 1 and 60.
For (int num=0; num , 60; num++) { If (num % 3 == 0) { System.out.println( “#: “ + dex);
}
}
While loop- While loops are best used when the exiting condition has nothing to do with the number of loops. The While loop tests the Boolean-expression at the beginning of the loop. It is in the form :
While (Boolean-expression) { nested statements}
The while loop can be used to prompt the user until the exit variable (any negative number) is entered. while ( input > 0) {
System.out.println(“Please enter number. Enter negative number to exit.”) }
Do while loop- It is best to use the do while loop when the iteration must be executed at least once. The do while loop tests the Boolean-expression at the end of the loop. It has the form: do { nested statements } while (Boolean-expression);
The do while loop can be used to show the same message multiple times. int tries = 3; int count = 1; do { System.out.println( “Incorrect password. Try again”); Count++;
} while (count <…...

Similar Documents

Premium Essay

Bsa 310 Week 3 Supporting

...BSA310 Week 3 Supporting Activity With the topic of accounting and finance it is important for business owners to know and understand the value of properly accounting for their cash flow, assets, and liability. This is especially true for new business owners who are just getting started. Accounting is one of the most important functions of a business because if done right the company will do fine and grow, but if done wrong or poorly, then the company will be in a virtual tailspin that will send the company out of business or even into bankruptcy. With accounting being such an important entity there are many options for an owner to choose from when it comes to accounting. Most options nowadays are accounting software applications of some kind, either web-based or stand-alone. However, some small businesses are still doing hard copy paper accounting, which is much more difficult in this day in age. Owner’s Equity One of the first concepts a new owner must understand is how he can determine his owner’s equity. This is a pretty simple business equation that can be best explained to be like the hands of justice, where they always need to be balanced. What happens on one end needs to happen on the other end to stay balanced. The equation is simply assets=liability+owners equity. This equation tells the owner where the company stands. The assets are what the company physically owns like work trucks and how much product. Where the liability is how much the company owes to......

Words: 775 - Pages: 4

Premium Essay

Week 3 Discussion 1 & 2

...Week 3 Discussion 1 From the e-Activity, develop a regression equation using the data you collected from your research. Use the regression equation to focus the demand for the product you chose for the next three periods. Assess what the results of the regression equation tells managers and how it is likely to impact decisions made related to maximizing profitability. I decided to take a brief look into Buffalo Wild Wings Chain future expansion near college campuses. The restaurant chain's management wants to determine the best locations in which to expand their restaurant business. So far the most successful locations have been near college campuses. This opinion is based on the positive numbers that quarterly sales (y) reflect and the size of the student population (x). Management's mindset is that over all, the restaurants that are within close proximity to college campuses with large student bodies generate more sales than restaurants located near campuses with small student bodies. Imagine you are a manager for the good or service used above. From the results of the regression equation, suggest strategies to either maintain demand (if an increase over three periods occurs) or improve demand (if a decrease over three periods occurs). Provide support for your recommendations. The regression analysis of the demand patron assures that managers are able to forecast the future sales. For profitability perspective, the demand for the future should show an increasing......

Words: 888 - Pages: 4

Premium Essay

Unit 1 (4dep) Activity 3

...Certificate in HR Practice Unit 1 (4DEP) – Developing Yourself as an Effective Human Resources Practitioner Activity 3 – Ability to reflect on own practice and development needs and maintain a plan for personal development Assessment Activity – 4DEP-F301A-(HR) Issued in September 2013 Name: To be inserted CIPD No: To be inserted Contents Ability to reflect on own practice and development needs and maintain a plan for personal development 3 Self-assessment against the CIPD Associate Membership Criteria –AC3.2 3 Development Plan and Records – AC3.4 3 Definition and Importance of Continuing Professional Development – AC3.1 3 Discussion with the Tutor (Optional) –AC3.1 4 Development Options for meeting my CPD needs – AC3.3 4 Appendix A – Development plan and records 5 Development Plan – 1 September 2013 to 31 August 2014 5 Development Records for the period – 1 September 2013 to 31 August 2014 5 Development Plan – 1 September 2014 to 31 August 2015 5 Ability to reflect on own practice and development needs and maintain a plan for personal development This is probably the most demanding section! Self-assessment against the CIPD Associate Membership Criteria –AC3.2 Once you have downloaded the AM criteria, you should be able to identify activities, knowledge and behaviours that you will need to develop. You should now see where the detailed information from activity one is useful. You should have detailed information on one of the areas......

Words: 1124 - Pages: 5

Premium Essay

Prg 420 Week 4 Individual

...Application Name System.out.println("Salesperson Annual Compensation Calculator\n"); int counter = 0; //counter while (true) { //Need at least 2. //When we reached 2, we can now ask user if user wants to add more. if (counter >= 2) { System.out.print("Enter another? Y for yes. Anything else for No: "); if (!input.nextLine().toLowerCase().equals("y")) { break; } } //Ask for user input. Validate as well :) do { System.out.print("Enter the name of salesperson: "); name = input.nextLine(); } while (name.length() < 1); annualSales = Utils.getDoubleInput("Please enter " + name + "'s annual sales: "); employees.add(new SalesPerson(name, annualSales)); //Check for highest earner boolean isHighest = true; for (int i = 0; i < employees.size(); i++) { if (employees.get(counter).totalCompensation < employees.get(i).totalCompensation) { isHighest = false; } if (employees.get(counter).totalCompensation != employees.get(i).totalCompensation) { allEqual = false; } } if (isHighest) { highestIndex = counter; ......

Words: 767 - Pages: 4

Free Essay

Netw 420 Week 1 Paper

...but now the NMS are quite sophisticated and do a lot more functionalities then just monitoring the network devices. NMS has advanced hardware and software to analysis and find out the performance bottlenecks and provide reports, are able to find out any fault in the network devices and able to provide proper graphical reports. NMS is able to deal with bandwidth allocation by load balancing. Network Management systems adopt various cryptographic algorithms for key distribution authorization. NMS also handles security management and configuration management. NMS devices monitor and collect data from all the network components and analyze the data for all the mentioned functioalities described as above. Major Functionalities of an NMS 1. Performance monitoring (Network and Server). Network Performance ● Monitor availability and performance, analyze traffic usage and manage configurations for routers, switches, firewalls, WAN accelerators, wireless access points. Server Performance ● Monitor server performance across multiple OSes; Supports monitoring Windows, Linux, Solaris, HP UX, IBM AIX servers (leverages SNMP, WMI & CLI for monitoring). ● Monitor server virtualization; Supports VMware and Hyper-V: Monitors over 100 deep performance metrics by leveraging VMware’s API and WMI. ● Monitor essential Microsoft services or applications viz. Exchange monitoring,Active Directory monitoring, MS SQL monitoring. ● Monitor Servers for CPU, Memory and Disk......

Words: 752 - Pages: 4

Premium Essay

Bsbwor501B Activity 3 1

...|Activity 3_1 | |Time stealers |Yes/ No |Can be by |Method | | | |me—yes/ no| | |Interruptions – telephone |Yes |Yes |Plan all calls to be made and make multiple | | | | |calls together to reduce the interruptions. | | | | |Screen calls during the day, and call back on | | | | |agreed times. | |Interruptions – personal visitors |Yes |Yes |Allow visitors during scheduled hours. | | | | |Communicate this to known visitors. Set definite| | | | |times when I don’t want to be interrupted. | |Mail and email |yes |Yes |Set......

Words: 788 - Pages: 4

Premium Essay

Week 1 E9-3

...Determine property, plant, and equipment costs E9-2 Trudy Company incurred the following costs. Debit Account 1. Sales tax on factory machinery purchased $5,000.00 Equipment 2. Painting of and lettering on truck immediately upon purchase $700.00 Equipment 3. Installation and testing of factory machinery $200.00 Equipment 4. Real estate broker’s commission on land purchased $3,500.00 Land 5. Insurance premium paid for first year’s insurance on new truck $880.00 Equipment 6. Cost of landscaping on property purchased $720.00 Land Imporvements 7. Cost of paving parking lot for new building constructed $17,900.00 Land Imporvements 8. Cost of clearing, draining, and filling land $13,300.00 Land Imporvements 9. Architect’s fees on self-constructed building $10,000.00 Buildings Instructions: Indicate to which account Trudy would debit each of the costs. Land - The cost of land includes (1) the cash purchase price, (2) closing costs such as title and attorney’s fees, (3) real estate brokers’ commissions, and (4) accrued property taxes and other liens assumed by the purchaser. Land Imporvements - are structural additions made to land. Buildings - all necessary expenditures related to the purchase or construction of a building. "Equipment - store check-out counters, office furniture, factory machinery, delivery trucks, and airplanes.The cost of equipment, such as Rent-A-Wreck vehicles, consists of the cash purchase price,......

Words: 250 - Pages: 1

Free Essay

Prg 410 Week 3 Assignment

...PRG 410 WEEK 3 ASSIGNMENT http://www.coursehomework.com/product/prg-410-week-3-assignment/ Contact us at:  +1 315-750-4434  help@coursehomework.com PRG 410 WEEK 3 ASSIGNMENT C++ Programming I PRG-410 Assignment#3 Problem 1: [marks 20] Write a program that implements simple game scenario. Game has two-player or a three-player MODE. For each MODE you have to choose among four HEROs. These are ALPHA, BRAVO, CHALIE and DELTA. You have to design and implement proper notation for each MODE and implement them accordingly using appropriate conditions e.g., First player is selecting ALPHA then Second Player can’t select ALPHA. Against each MODE ask five values for each player if: • Ask input range is between (1-100) player will win with 10 points for one value. • Ask input range is between (101-200) player will win with 20 points for one value. • Ask input range is between (201-500) player will win with 50 points for one value. Add all five values for HERO/HEROs and printout the winner of the game. Problem 2: Rock, Paper, Scissors Game [marks 20] Write a program that lets the user play the game of Rock, Paper, and Scissors against the computer. The program should work as follows. 1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don’t display the...

Words: 933 - Pages: 4

Premium Essay

Week 3 Assignment 1

...service's and goods. Based on the past procurement scandal in October 2014 with the VA. Analyzing FAR Regulations The Federal Acquisition Regulation better-known as FAR was put into effect on April 1, 1984, for the sole purpose to set regulations for all federal executive agencies. FAR is issued, and maintained by Administrator at GSA (General Services Administration), the Secretary of Defense at DOD (The Department of Defense), and by the Administrator of NASA (National Aeronautics and Space Administration). (Feldman, 2014-2015, pp. 17-19). Also, FAR 3.1 has governed that individual agency are required to create own Standard of Conduct to safeguard against improper business practices and personal conflicts. I would like to take a closer look at the regulations and see if they offer the adequate protection of the collective bargaining power of the American people. As a contracting officer for the IRS, I want to make sure I am operating within these regulations so that I can get the best possible software without wasting the American people’s money. As contracting officer FAR gives me the authority to enter, into, administer, or terminate contracts and make related determinations and findings. (acquisition.gov FAR, pp. 1.602-1) Under this regulation, I have the authority as a CO to make a decision on what software company can provide the IRS the best software at the best price. Also I am charged with the responsibility of staying......

Words: 1398 - Pages: 6

Premium Essay

Proj 420 Week 1

...PROJ 420 WEEK 1 A+ Graded Tutorial Available At: http://hwsoloutions.com/?product=proj-420-week-1 Visit Our website: http://hwsoloutions.com/ Product Description PRODUCT DESCRIPTION PROJ 420 WEEK 1, Objectives of the Risk Process: The short-term goals of the project are; • To achieve break-even in first year • To have minimum traffic of 50,000 visitors in first six months and a traffic of 20,000 visitors every month from sixth month till one year • To have the sales of minimum $10,000 in first year • To generate additional advertising revenue of $1,000 in first year. The long-term goals of the project are; • To have profit margin of 20% from 5th year onwards • To have annual sale of $80,000 from 3rd year. As the website selling ebooks is an online business, the risks associated with the business are moderate. There are some situations that presents high risk such as hacking attempts, fraud transactions, money chargebacks and customer password compromise. The tolerable risk level is moderate because investment would be made in SSL certificates to ensure Objectives of the Risk Process: The short-term goals of the project are; • To achieve break-even in first year • To have minimum traffic of 50,000 visitors in first six months and a traffic of 20,000 visitors every month from sixth month till one year • To have the sales of minimum $10,000 in first year • To generate additional advertising revenue of $1,000 in first year. The long-term goals of the......

Words: 332 - Pages: 2

Free Essay

Prg Week 3 Dq2

...WEEK 3 DQ 2 PRG 211 * What are the similarities and differences between single alternative structures, dual alternative structures, and case structures? Provide an example of one of the three control structures using pseudocode. Try to provide an example that has not already been posted. Selection structures ask a question and, depending on the answer, take one of two courses of action. Then, no matter which path is followed, they continue on the next task. Structured programming is a programming paradigm aimed on improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and for and while loops. A single-alternative structure is a single block of statements to be executed or skipped. When a single alternative selection structure returns the value of true, the actions on the true branch of the structure are executed. If the expression returns false, no actions are executed and the program control continues to the next executable statement structure in the program. Dual-alternative structures contain two blocks of statements, one of which is to be executed, while the other one is skipped. A case structure executes one sub diagram depending on the input value passed to the structure. Only one sub diagram is visible at a time, and the structure executes only one case at a time. Case structures easily support multiple simple conditions that have similar actions compared to if/else statements.......

Words: 557 - Pages: 3

Premium Essay

Week 8 Activity 1

...Week 8 Activity 1 1. Best available treatment: a water treatment that is the most current and best available through research even though it may not be the treatment used most frequently. 2. Best conventional treatment: a water treatment that is generally used among industries; not always the best treatment available. 3. Clean Air Act: federal legislations that establishes standards for air pollution levels and prevents further deterioration of air quality. 4. Clean Water Act: federal legislations that regulates water pollution through a control system. 5. Due diligence: process of checking the environmental history and nature of land prior to purchase. 6. Emissions offset policy: controls whether new factories can be built in a non-attainment area. 7. Environmental impact statement (EIS): formal report prepared under NEPA to document findings on the impact of a federal project on the environment. 8. Injunction: order of a court of equity to refrain from doing or to do a specified act. 9. Private nuisance: nuisance that affects only one or a few individuals. 10. Zoning: restrictions imposed by government on the use of designated land to ensure an orderly physical development of the regulate area. 1. Solid waste disposal regulations today deal almost entirely with recycling. False 2. The EPA has the authority of have activities halted through the use of injunction. True 3. Conduct that unreasonably interferes with the enjoyment......

Words: 255 - Pages: 2

Premium Essay

Prg 420

... Course Overview Week One includes an overview of how programming languages work and an introduction to Java™ and the Java™ Virtual Machine (JVM). The JVM is what enables the same Java™ program to run unchanged on multiple platforms. You learn Java™ syntax by writing a program that compiles and executes. You begin with the simplest programs that display a message to the user; however, the structure that you use carries forward into more complex programs later on. Week Two focuses on two of the most important concepts in programming: selection and repetition. Selection allows you to make a choice between alternatives and determine which block of statements will be executed as a result. Repetition allows the program to repeat a block of code multiple times. This enables you to write programs that can do a lot of processing with very few lines of code. For example, you may want to read all of the records in a data file. With a repetition structure, you can write this in just a few lines. If repetition structures were not available, you would have to write a line of code for every record in the file. In Week Three, you will look at methods and constructors in a lot more detail. A method signature is made up of an access modifier, an optional specifier, a return type, and a list of parameters. Understanding the differences between public, private, protected will help you design methods that help you achieve the goal of data encapsulation. Week Four takes us into an......

Words: 553 - Pages: 3

Premium Essay

Week 3 Supporting Activity Bsa 375

...Week 3 Supporting Activity: Website Critique University of Phoenix Online BSA 375 Marc Portner April 29, 2012 Apple is a company that does things what appears to be the right way. Their products are brilliant! They are advanced and highly adored by many. There is a certain loyalty to their products that make them appear to be almost a cult. They thrive on simplicity of use and user experience. This is exactly what happen when you log onto their website. The experience is simple and enjoyable. Critique of Apple’s website First and foremost, I must admit, I am an Apple enthusiast. I adore their products and use them everyday. As a matter of fact, I am typing this assignment on my MacBook. However, this is not the reason I picked their website for this assignment. I picked it because it is well designed and easy to navigate. The following paragraphs are my critique of Apple’s website. Which of the six design principles do you see being utilized in this website? Provide examples. In my honest observation and opinion, Apple’s website follows the six design principles. The website is very anesthetic. The website uses a mostly white background that allows the content to be visible and appealing. The content is well laid out on the website and does not intrude with each other on the webpage. User experience is very high. This is usually what Apple thrives on, user experience. Anyone regardless if they are new to Apple products or are avid user......

Words: 514 - Pages: 3

Premium Essay

Assignment 1 Week 3

...to help combat these issues. The Environmental Protection Agency (EPA) has been trying to continuously to get the issues or problem with pollution under control. The Environmental Protection Agency is a federal government agency that helps protect human health and the environment. The organization is responsible for writing and enforcing regulations and laws that are presented to congress with hopes of being approved. Environmental Protection Agency’s main objective is to protect the planet from harmful and toxic waste being dumped in land, water and air. Environmental Protection Agency was established on December 2, 1970. It was created into one agency with a variety of federal research, monitoring, standard-setting and enforcement activities to ensure environmental protection (www.epa.org). The EPA attempts to help create a cleaner and healthier environment for its people. The EPA has stepped into many cases that violate the laws set forth. One incident from the EPA newsroom, EPA Files Complaint Against Maine Dairy Farm to Require Compliance with Clean Water Standards, which required the EPA to step in to protect the rivers, streams and lakes of Dixmont, Maine. This was due to the fact that some farmers decided to dump manure and contaminated wastewater into nearby waters. The EPA tested the waters and found the water was in fact contaminated and the farmers were found violating the Federal Clean Water Act regulations while operating a dairy farm, in Dixmont, Maine.......

Words: 1501 - Pages: 7