0

This is the problem amd im not sure how to do it. This class from what my otherclassmates have been telling is that I should already know how to do the pseudocode. But my teacher does not explain anything but this is what I have came up with.

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

1. A Dog class that holds fields for ID number of owner, an the name, breed, age, and weight of the dog. Include get and set methods for each field.

2. An Owner class that holds ID number of owner, and owner's name, address, and phone number. Include get and set methods for each field.

3. A method that accepts two objects--a Dog and an Owner. If the Dog and Owner IDs do not match, display an error message. Otherwise, display a bill containing the Owner and Dog data and the weekly day care fee which is $55 for dogs under 15 pounds, $75 for dogs at least 15 pounds but no more than 30 pounds, $105 for dogs over 30 pounds but no more than 80 pounds, and $125 for dogs over 80 pounds.


ownerDOGclass
IDnumber
Breed
Age
Weight

This is all I got. I know its not much but I dont understand it please help.

3
Contributors
4
Replies
6
Views
9 Years
Discussion Span
Last Post by Abzero
0

Pseudocode is a language-agnostic way of writing a computer problem. Its used as the step before writing the actual code for a program (sometimes) or at least a small routine/algorithm (most of the time). It depends a lot on the person who writes the pseudocode how it is formatted and how explicit it is about some things, but you should generally try to avoid using extremely language specific ideas, such as "make a vector of integers". It's usually along the lines of

Dog class:

variables (private)
number: owner's ID
string: name
string: breed
number: age
number: weight

methods (public)
getID: returns owner's ID
setID: set owner's ID

And so forth. However you want to structure it is fine, writing a program in pseudocode first is supposed to let you get the whole idea of the program, how the different parts interact and how you are going to write the program before you focus on the implementation/language dependent details such as memory allocation and management. This is the style of pseudocode that I've always used, but throughout my school career I've never had someone apply pseudocode as a rigorous science, but someone more experienced than me may know better.

0

Thanks anything helps. Because Im really struggling with it I have about 3 more weeks left of it and I just gave up now im trying to do it again.

0

Pseudocode is a language-agnostic way of writing a computer problem. Its used as the step before writing the actual code for a program (sometimes) or at least a small routine/algorithm (most of the time). It depends a lot on the person who writes the pseudocode how it is formatted and how explicit it is about some things, but you should generally try to avoid using extremely language specific ideas, such as "make a vector of integers". It's usually along the lines of

Dog class:

variables (private)
number: owner's ID
string: name
string: breed
number: age
number: weight

methods (public)
getID: returns owner's ID
setID: set owner's ID

And so forth. However you want to structure it is fine, writing a program in pseudocode first is supposed to let you get the whole idea of the program, how the different parts interact and how you are going to write the program before you focus on the implementation/language dependent details such as memory allocation and management. This is the style of pseudocode that I've always used, but throughout my school career I've never had someone apply pseudocode as a rigorous science, but someone more experienced than me may know better.

Thanks anything helps. Because Im really struggling with it I have about 3 more weeks left of it and I just gave up now im trying to do it again.

0

pseduocode is a way of writting down the logic with out dealing with the implementation details; it can be very code like or very english like.

for example, pseduocode for swaping the order in an array:

for i = 0 ... n/2 and j = n ... n/2 then
swap i'th element of array with j'th element of array
next

notice the implementation of is intuitivly given.

I could also have written it like

for i = 0, i < N/2, i = i + 1
temp = array
array = array[n-i]
array[n-i] = temp
next

which is also pseducode.

So basically write down the logical steps you think you need for your problem; and you've most likly written pseducode.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.