subject
Computers and Technology, 15.09.2021 09:20 janny48

Debug / 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 salesQuarter3ThisYear
num salesQuarter1LastYear
num salesQuarter2LastYear
num salesQuarter3ThisYear
num salesQuarter4LastYear
num totalThisYear
num totalLastYear
string status
num QUIT = ""
housekeeping()
while department <> QUIT
compareProfit()
endwhile
finishUp()
stop

housekeeping()
output "Enter department name or ", QUIT, " to quit "
input dept
return

compareProfit()
getSalesData()
sumSalesData()
if totalThisYear = totalLastYear then
status = "Higher"
else
if totalThisYear <= totalLastYear then
status = "Lower"
else
status = "Same"
endif
endif
output department, status
output "Enter department name or ", QUIT, " to quit "
input department
return

getSalesData()
output "Enter sales for first quarter this year "
input salesQuarter1ThisYear
output "Enter sales for second quarter this year "
input salesQuarter1ThisYear
output "Enter sales for third quarter this year "
input salesQuarter1ThisYear
output "Enter sales for fourth quarter this year "
input salesQuarter4ThisYear
output "Enter sales for first quarter last year "
input salesQuarter1LastYear
output "Enter sales for second quarter last year "
input salesQuarter3LastYear
output "Enter sales for third quarter last year "
input salesQuarter3LastYear
output "Enter sales for fourth quarter last year "
input salesQuarter3LastYear
return

sumSalesData()
totalThisYear = salesQuarter1ThisYear + salesQuarter2ThisYear +
salesQuarter2ThisYear + salesQuarter4ThisYear
totalLastYear = salesQuarter2LastYear + salesQuarter2LastYear +
salesQuarter3LastYear + salesQuarter4LastYear
return

finishUp()
output "End of report"
return

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
Which statement best explains how plant cells use photosynthesis to maintain homeostasis? they use glucose and water to make energy. they break down glucose into fat. they combine oxygen and water to make glucose. they make glucose from carbon dioxide and water.
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Choose the answers that best complete each sentence. on average,are more expensive than other kinds of postsecondary schools. the cost of room and board includes. to save money, some students attend auniversity in their home state.
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
You know the right answer?
Debug / This pseudocode should create a list that describes annual profit
// statistics for...
Questions
question
History, 07.03.2020 02:13
Questions on the website: 13722360