How to do this? Is answers correct? I have no idea about what the values of the input means?

Chee Jack
Chee Jack used Ask the Experts™
on
The COO of AEON Co. Ltd would like to know each store’s percentage of sales from the total sales of all 12 AEON stores in Malaysia. Write the pseudocode and draw the flowchart for this program. Hint: Use array.

To check your understanding of this problem, answer these questions:
How many times the loop should be running?
→12
What will be entered by the user in the loop?
→ total sales of each store
List down all the values of the input (you can fake it but make sure the values are logic) that the user need to enter.

What will be accumulated in the loop?

From the fake values that you’ve entered, what is accumulated value?

From the accumulated value, what do you need to find?

How to find it? Where should this equation be used? In the loop or outside the loop?


Where to save it?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dr. KlahnPrincipal Software Engineer

Commented:
Is answers correct?

We won't know that until you show us your work so far!

Author

Commented:
"List down all the values of the input (you can fake it but make sure the values are logic) that the user need to enter."

What does this question needs?
Top Expert 2016
Commented:
 [double[]] $sales = 1000,2000,2005,5000,6000,8000
 $companycount = 0
 $totalsales = 0
 for($counter =0; $counter -le $sales.Count; $counter++){
 
 $totalsales += $sales[$counter]
 
 }
 for($counter =0; $counter -lt $sales.Count; $counter++){
 $percentage = ($sales[$counter]/$totalsales) * 100
 write-output("Store $counter has {0:N2} percentage of Sales" -f $percentage)
 
 }

Open in new window

Top Expert 2016

Commented:
accepted due to lack of author response

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial