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

The Barking Lot is a dog day care center. Design pseudocode for the following: A

ID: 3873191 • Letter: T

Question

The Barking Lot is a dog day care center. Design pseudocode for the following:

A program that accepts data for an ID number of a dog's owner, and the name, breed, age, and weight of the dog. Display a bill containing all of the input data as well as the weekly day care fee, which is $55 for dogs under 15 pounds, $75 for dogs from 15 to 30 pounds inclusive, $105 for dogs from 31 to 80 pounds inclusive, and $125 for dogs over 80 pounds.

Next, modify the program so that it continuously accepts dogs’ data until a sentinel value is entered, and displays billing data for each dog. Copy the existing pseudocode and paste it into a 2nd page of the same document.

Explanation / Answer

// Pseudo code for bill ok Barking Lot
BEGIN
  
DECLARE
       ID_number
       owner
       name
       breed
       age
       weight
       fee

   PRINT    'Enter ID Number'
   READ   ID_number

   PRINT    'Enter dog owner'
   READ   owner

   PRINT    'Enter dog name'
   READ   name

   PRINT    'Enter breed'
   READ   breed

   PRINT    'Enter age'
   READ   age

   PRINT    'Enter weight'
   READ   weight

   IF wieght IS LESS THAN 15
       fee = 55
   ELSE IF wieght IS LESS THAN EQUAL TO 30  
       fee = 75
   ELSE IF wieght IS LESS THAN EQUAL TO 80  
       fee = 105
   ELSE IF wieght GREATER THAN 80
       fee = 125
   END IF
      
   PRINT '------- DOG Info --------'

   PRINT 'ID Number'
   PRINT ID_number

   PRINT 'Dog Owner'
   PRINT owner

   PRINT 'Breed'
   PRINT breed

   PRINT 'Age '
   PRINT age

    PRINT 'Weight '
   PRINT weight

   PRINT 'the weekly day care fee'
   PRINT fee

//End pseudo code



// using sentinal value

BEGIN PSEUDO CODE
  
DECLARE
       ID_number
       owner
       name
       breed
       age
       weight
       fee
       choice

   DO
       PRINT    'Enter ID Number'
       READ   ID_number

       PRINT    'Enter dog owner'
       READ   owner

       PRINT    'Enter dog name'
       READ   name

       PRINT    'Enter breed'
       READ   breed

       PRINT    'Enter age'
       READ   age

       PRINT    'Enter weight'
       READ   weight

       IF wieght IS LESS THAN 15
           fee = 55
       ELSE IF wieght IS LESS THAN EQUAL TO 30  
           fee = 75
       ELSE IF wieght IS LESS THAN EQUAL TO 80  
           fee = 105
       ELSE IF wieght GREATER THAN 80
           fee = 125
       END IF
      
       PRINT '------- DOG Info --------'

       PRINT 'ID Number'
       PRINT ID_number

       PRINT 'Dog Owner'
       PRINT owner

       PRINT 'Breed'
       PRINT breed

       PRINT 'Age '
       PRINT age

      PRINT 'Weight '
       PRINT weight

       PRINT 'the weekly day care fee'
       PRINT fee

       PRINT 'Do you want to continue press y or Y ?'
       READ choice

   WHILE choice EQUAL TO 'y' or 'Y';
END  

// End pseudo code