We have received new requirements from the user. They would like start this program in the morning when they open and then close it when they walk their last dog in the evening. When they are all done they want to know how many clients they served and what was the total amount they billed during the day.
In order to do that we need to use two types of assignments: Accumulators and Counters. The both work the same way. Assign to a place in memory what is returned when we add a value to what is already in that same place in memory. If we are doing a counter it's almost always the same loopnumber = loopnumber + 1. We are assigning to the place in memory called loopnumber what is returned when we take what is already in loopnumber and add 1 to it. In this problem they want to know how many clients they service throughout the day. Every time we run the loop code in our program that represents a client being serviced. So if we add "loopnumber = loopnumber + 1" to our loop code we can simply output the loopnumber to display how many clients have been serviced. There's nothing magical about calling the place in memory "loopnumber" we could have just as easily written: "numberofclients = numberofclients + 1".
Using an accumulator is the same except instead of adding "1" we are adding a value we want to accumulate. When we output how much a client owes we use the place in memory called finalfee. If we want to "accumulate" a running total of all the fees collected then we want to add a line of code that says, "assign to a place in memory what is returned when we add the finalfee to what is already in that place in memory. For example: FinalfeeAccum = FinalFeeAccum + FinalFee. We would place this line of code right after the line of code where we figured out what the finalfee was for the client.
You have been asked to write a computer
program for a dog walking service. This business provides a unique service
walking dogs. They charge $5.00 an hour for this service per dog walked. They
take dogs on walks that can span several hours and many of their clients have
more than one dog that will be walked. All dogs for a client are walked at the
same time and the same duration. They want to be able to find out how much they need to charge the owner.
They will be using this program all day long so they want to be asked if they
have another customer after the previous customer's bill has been displayed.
At the end of the day they want to know how many clients were serviced and how
much money was collected.
Provide me with:
1. Assumptions:
2. Input
3. Calculations:
4. Output
Assumptions:
a. All dogs have the same walking fee
b. All dogs for a client are walked the same amount of hours
c. One client's fee will be calculated at a time
d. The fee is a constant $5.
e. The program will be started at the beginning of the day and closed at
the end
Input:
a. Number of dogs
b. Hours walked
c. Is there another customer yes/no
Calculations:
a. Finalfee = number of dogs * hours walked * 5
b. loopnumber = loopnumber + 1
c. FinalFeeaccum = finalfeeaccum + finalfee
Output:
a. "You need to charge the owner" & FinalFee
b. "The number of clients serviced today is " & loopnumber
c. "The amount of money collected today is $" & finalfeeaccum
Now you need to write the Human Algorithm (step by step how would you come up with the final output:
1. Ask for the number of dogs
2. Ask for how many hours they were walked
3. Final Fee = Number of dogs * Number of hours * 5
4. Loopnumber = Loopnumber + 1
5. finalfeeaccum = finalfeeaccum + finalfee
4. Tell them: "You need to charge the owner" & FinalFee
5. Ask if they have another customer, if so, return to 1. above
5. Tell them how many clients served
7. Tell them how much money has been collected
Now we need to flowchart this Human Algorithm. Remember each step is a different flowchart symbol. Don't combine steps.

VB Code:<script language=vbscript>
Option Explicit '<-- This will not allow us to use a variable (place in memory)
in our code that doesn't exist in our DIM statement
Dim numdogs, numhours, finalfee, anothercustomer, loopnumber, finalfeeaccum
anothercustomer = "yes" '<---Set's initial value for the loop
Do While anothercustomer = "yes"
numdogs = inputbox("How many dogs did you walk?")
numhours = Inputbox("How many hours did you walk them")
finalFee = numdogs * numhours * 5
loopnumber = loopnumber + 1 '<----counting the number of clients
finalfeeaccum = finalfeeaccum + finalfee
Msgbox("The charge for walking the does is $" & finalfee)
anothercustomer = Inputbox("Do you have another customer? yes/no")
Loop ' <--- goes back to the Do While line
document.write "Today you serviced " & loopnumber & " clients and you recieved "
& formatcurrency(finalfeeaccum) & " in fees"
</script>
.