FIXDEBUG04-02.txt - This pseudocode should create a list...

This preview shows page 1 - 2 out of 2 pages.

// This pseudocode should create a list that describes annual profit // statistics for a retail store. Input records contain a department // name (for example, Cosmetics ) and profits for each quarter for // the last two years. The program should determine whether // the profit is higher, lower, or the same // for this full year compared to the last full year. start //Declarations string department num salesQuarter1ThisYear num salesQuarter2ThisYear num salesQuarter3ThisYear num salesQuarter4ThisYear num salesQuarter1LastYear num salesQuarter2LastYear num salesQuarter3LastYear num salesQuarter4LastYear num totalThisYear num totalLastYear string status string QUIT = "ZZZZ" housekeeping() while department != QUIT getSalesData() compareProfit() finishUp() stop housekeeping() output "Enter department name or ", QUIT, " to quit " input department return compareProfit() getSalesData() sumSalesData() if totalThisYear > totalLastYear then status = "Higher" elseif totalThisYear < totalLastYear then status = "Lower" else status = "Same" output department, status output "Enter department name or ", QUIT, " to quit "
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

Unformatted text preview: input department return getSalesData() output &quot;Enter sales for first quarter this year &quot; input salesQuarter1ThisYear output &quot;Enter sales for second quarter this year &quot; input salesQuarter2ThisYear output &quot;Enter sales for third quarter this year &quot; input salesQuarter3ThisYear output &quot;Enter sales for fourth quarter this year &quot; input salesQuarter4ThisYear output &quot;Enter sales for first quarter last year &quot; input salesQuarter1LastYear output &quot;Enter sales for second quarter last year &quot; input salesQuarter2LastYear output &quot;Enter sales for third quarter last year &quot; input salesQuarter3LastYear output &quot;Enter sales for fourth quarter last year &quot; input salesQuarter4LastYear return sumSalesData() totalThisYear = salesQuarter1ThisYear + salesQuarter2ThisYear + salesQuarter3ThisYear + salesQuarter4ThisYear totalLastYear = salesQuarter1LastYear + salesQuarter2LastYear + salesQuarter3LastYear + salesQuarter4LastYear return finishUp() output &quot;End of report&quot; return...
View Full Document

  • Fall '19
  • Two years, output department

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors