Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

DONT DO THE FLOWCHART I NEED (Algorithm, Pseudocode and desk-checking) Case: The

ID: 3886640 • Letter: D

Question

DONT DO THE FLOWCHART I NEED (Algorithm, Pseudocode and desk-checking)

Case: The Barking Lot In Chapter 1, you thought about the objects needed for programs for The Barking Lot-a dog boarding facility. One required program must be able to estimate profits for a day. The facility can board eight dogs at a time: it charges $25 a day for dogs that weigh more than 50 pounds and $20 a day for smaller dogs. The facility's expenses include $2 per day per dog for food (no matter the size of the dog), and $30 per day for utilities. Develop the logic for a program that allows a user to enter the number of large dogs boarded: assume that the rest are small dogs and that the facility is full. Output is the total revenue collected for the day, total expenses, and the difference. Show the algorithm, pseudocode, flowchart and desk-checking. You may draw the flowchart using freehand or using an application such as Microsoft Word or Visual Logic (PIN to use comes with textbook purchase) or Google Docs (select File, New Drawing & insert flowchart shapes or click on Add-Ons and connect to the free LucidChart app).

Explanation / Answer

Algorithm is depicted with the help of flow chart in which the input i.e. the number of large dogs in the The Barking Lot is passed to the function the barking lot as follows:

Algo TheBarkingLot(largeDogs)

{

smallDogs = 8 - largeDogs

revenue = 25 * largeDogs + 30 * smallDogs

totalExpenses = 8 * 2 + 30 //2 is the food expense & 30 is utilities expense

profit = revenue - totalExpenses

return (revenue,totalExpenses,profit)

}

DESK CHECKING:

largeDogs = 4

smallDogs = 8 - 4 = 4

revenue = 4*25 + 4*20 = 180

totalExpenses = 46

profit = 180 - 46 = 134