Write a while and a do-while loop

Assignment Help Programming Languages
Reference no: EM13764356

Pick one or more examples from everyday life and write a WHILE and a DO-WHILE loop.

For example, the classic "lather, rinse, repeat" on a shampoo bottle could be written as:

while (hair dirty)

{

Lather;

Rinse;

}

or as

do

{

Lather;

Rinse;

} while (hair dirty);

While my examples are very similar they are not logically equivalent. If a person has clean hair, they will not wash at all in the first example. In the second example they will lather and rinse at least once. Are your examples equivalent? (It depends on how you set it up).

Reference no: EM13764356

Questions Cloud

Difference between a business case and a business plan : Define Business Case and explain the difference between a Business Case and a Business Plan.
Memorandum of law : A Memorandum of Law entitled "Memorandum of Law: Executive Order 12333" (The Army Lawyer, December 1989)
Analysis of the international legal issues : Prepare a research paper in APA format that demonstrates your analysis of the international legal issues that are involved in both examples. Specifically, your paper must include the following elements in addition to answering the questions in eac..
Executing privileged commands without the root password : Explain how you would allow the user to execute a specific, privileged command without giving the user the root password or permission to use the sudo to run any command with root privileges. Provide the exact steps you would follow and clearly ex..
Write a while and a do-while loop : Pick one or more examples from everyday life and write a WHILE and a DO-WHILE loop.
Write a paper on the life of li-young lee : Write a paper on the life of Li-Young Lee. Please consider the relationships and themes that dominate Rose. Please choose at least five poems for your analysis and include brief quotations of verse.
How to properly verify a new forensics software package : You are developing a policy and procedure on how to properly verify a new forensics software package. You need to present this new procedure to the Captain over the Computer Forensics Lab
Problems related to ethical criteria : Where do you draw the line when using material found on the Internet, but trying to respect the artists' intellectual property and rights to royalties from their creations?
Leveraging power from batna : Assuming your Best Alternative to a Negotiating Agreement (BATNA) is letting a court sell the property, discuss how it may help you reach an agreement. Recommend other strategies that you could use to accomplish a successful negotiation.

Reviews

Write a Review

Programming Languages Questions & Answers

  Design and implement a java program

Design and implement a Java program which defines an array of size SIZE, randomly populated with Integer or int values in the range 1 .. MAXRNG and sorts the array in increasing order of its values using QuickSortOpt1 and then by QuickSortOpt2. Consi..

  Build your own maze

Build your own maze and make it so easy so i can understand it. try to use for while statement. it is an easy task so please do not make it complicated and follow the instructions that im going to post. another thing do not use the maze that in th..

  One-dimensional as array of counters to solve problem

Write program which determines how many salespeople earned salaries in each of following ranges. Use the one-dimensional as the array of counters in solving this problem

  Write pseudocode

Write pseudocode that represents the abstract functions of the enqueue and dequeue operations. Define and explain any supplementary information needed by your pseudocode.

  Create class templates for administrative employess

Create classes or class templates for the following: Administrative Employess are paid a salary, but they also receive a bonus at regular intervals during the year.

  Write a perl subroutine that reads in a file containing two

write a perl subroutine that reads in a file containing two strings on each line and creates a hash with the first

  Draw a erd model a manufacturing company

Draw a ERD model A manufacturing company has several assembly plants in different cities. Each plant produces one product which requires certain parts in its assembly.

  Enter codes of one to eight characters along

Consider a program to enter codes of one to eight characters along with an associated telephone number and associated notes. A code can represent a person's name, a person's initials, a place, or anything.

  Application to feature a gui

A program written in Dr. Racket Scheme that makes use of lists, higher order procedures (e.g. map, filter, reduce) and/or recursion. If all of those could be used it would be best

  The given code is meant to find out the largest item of a

the following code is meant to find the largest item of a list but the lines are out of order. the following code is

  Write a function that accepts an array a as input and

write a function that accepts an array a as input and searches the contents of the array for elements in three

  Validation case using regexp

The user must enter a valid IPV4 number in the range 0.0.0.0 to 255.255.255.255(decimal numbers). The number in each category must be between 0-255.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd