School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,213 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,557 people online right now. Registration is fast and FREE... Join Now!




Control Break problem

 

Control Break problem, Desperate for help

jpconleyiv

13 Apr, 2009 - 03:22 PM
Post #1

D.I.C Head
Group Icon

Joined: 9 Mar, 2009
Posts: 88



Thanked: 4 times
My Contributions
Ok below I have typed the problem. Below that I have typed what I have been spending the entire day working on. I have already made the mock-up chart, print chart, and sample records.

The problem:
The Finley Fine Art shop maintains records for each item in the shop, including the title of the work, the artists who made the item, and the medium (watercolor, oil, clay), and the monetary value. The records are sorted by the artist within medium. Design the logic that produces a report that lists all items in the store, with a minor total value following each artists work, and a major total following each medium.

What I have developed so far:
Print chart (sample of mine)

Title Value Artist Medium
xxxx 99999 xxxx xxx

Medium Total 99999

Value equaling the minor total following each artists work.
Medium Total equaling major total following the medium.


Pseudocode:


Start
perform housekeeping ()
while not eof
perform mainloop()
endwhile
perform finishUp()
Stop

housekeeping()
string Title
string Artists
string Medium
num Value
num Total = 0
string Header = "The finely Fine Art Shop"
string ColHead = "Title Artist Value Medium "
string footer = "Items in store"
print Header
print ColHead
get Title,Value,Artist,Medium

return

mad.gif THIS IS WHERE I AM TOTALLY CONFUSED mad.gif
Do I approach the mainloop() with an "if" statement like-

if medium not = value then ?????

I really don't know what direction to take the rest of the assigment. crazy.gif

This is my sixth lab I have never gotten less than 25 out of 30 and I am freaking out because I am very lost on this and If any of you bright minds can help it would be the best thing EVER!!!
I also really need to learn because I'm going into programming not someone just taking the course, unfortunately my Prof. does not teach she gives a paper telling us what to do for a certain date and we do not see her until the next assignment.

User is offlineProfile CardPM
+Quote Post


jpconleyiv

RE: Control Break Problem

13 Apr, 2009 - 06:01 PM
Post #2

D.I.C Head
Group Icon

Joined: 9 Mar, 2009
Posts: 88



Thanked: 4 times
My Contributions
Ok still working at it and now this is what I have came up with, I sure hope Its on the right track.

Start
perform housekeeping()
while value is > 0
perform ClayBreak()
perform Oilbreak()
perform WaterColorBreak ()
endwhile
perform finish()
Stop

housekeeping()

string Title
string Artist
string Medium ( Clay, Oil, Water Color)
num value= 0
numTotalValue = 0 (total amount of entered values)
string Header = “The Finley Fine Art Shop”
string ColHead = “Title Value Artist Medium “
string Footer = “Items in Store”
num MediumTotal= 0
print Header
print ColHead
get Title, Value, Artist, Medium
print Title,Value,Artist, Medium
return


ClayBreak()

if TotalValue > 0 then
MediumTotal = MediumTotal + TotalValue
endif
print MediumTotal
perform OilBreak()

return

OilBreak()

while TotalValue > 0 then
MediumTotal = MediumTotal + TotalValue
endwhile
print MediumTotal
perform WaterColorBreak()
return

WaterColorBreak()

while TotalValue > 0
MediumTotal = MediumTotal + TotalValue
endwhile
print MediumTotal
perform FinishUp()

return

FinishUp()
print Footer
perform housekeeping()
return



User is offlineProfile CardPM
+Quote Post

kidego71

RE: Control Break Problem

27 Oct, 2009 - 01:42 PM
Post #3

New D.I.C Head
*

Joined: 27 Oct, 2009
Posts: 1

QUOTE(jpconleyiv @ 13 Apr, 2009 - 06:01 PM) *

Ok still working at it and now this is what I have came up with, I sure hope Its on the right track.

Start
perform housekeeping()
while value is > 0
perform ClayBreak()
perform Oilbreak()
perform WaterColorBreak ()
endwhile
perform finish()
Stop

housekeeping()

string Title
string Artist
string Medium ( Clay, Oil, Water Color)
num value= 0
numTotalValue = 0 (total amount of entered values)
string Header = “The Finley Fine Art Shop”
string ColHead = “Title Value Artist Medium “
string Footer = “Items in Store”
num MediumTotal= 0
print Header
print ColHead
get Title, Value, Artist, Medium
print Title,Value,Artist, Medium
return


ClayBreak()

if TotalValue > 0 then
MediumTotal = MediumTotal + TotalValue
endif
print MediumTotal
perform OilBreak()

return

OilBreak()

while TotalValue > 0 then
MediumTotal = MediumTotal + TotalValue
endwhile
print MediumTotal
perform WaterColorBreak()
return

WaterColorBreak()

while TotalValue > 0
MediumTotal = MediumTotal + TotalValue
endwhile
print MediumTotal
perform FinishUp()

return

FinishUp()
print Footer
perform housekeeping()
return



WOW!! I cant thank you enough for sharing this...this one had me stuck for a week! This definitely helps point me in the right direction!
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 09:52PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month