Design a class named Book that holds a stock number, author, title, price, and number of pages for a book. Include a method that sets all the data files and another that prints the values for each data field. Create the class diagram and write the pseudocode that defines the class.
Pls I need help with this logic programming?
I can't give you the entire answer ,as that would be cheating, but here is a sample:
---
create class "Book"
create variable "stockNumber"
create variable "title"
start method "setData" with parameters: stockNumber2, title2
set global variable "stockNumber" to local variable "stockNumber2"
set global variable "title" to local variable "title2"
end method "setData"
start method "printData"
display global variable "stockNumber"
display global variable "title"
end method "printData"
end class "Book"
---
There you go! Remember pseudo code can have any format, and your teacher probably doesn't expect you to know 'global' and 'local' variables, so readjust this, add some things, and take out things you don't understand. This is an example, but make sure when you make it, you understand it!
Reply:yeah seriously no one is going to take the time to code your homework. How about you try to do it then ask specific questions if you get stuck?
Reply:hey! can you tell me what programming language are you using!? does your data need to be in a database!?
Reply:That's a homework assignment, right?
We don't do other people's homework here.
Get started, and if you're still stuck, write to me.
Better yet, write to your own teacher.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment