HSC Stuff => HSC Technology Stuff => HSC Subjects + Help => HSC Software Design and Development => Topic started by: JTrudeau on April 15, 2018, 06:52:30 pm
Title: SDD Algorithm Contest (ALCON) | Problem 1: IKEO
Post by: JTrudeau on April 15, 2018, 06:52:30 pm
The furniture store IKEO is looking to find out their most popular rolls of fabric. There are three main types of fabric: plain, striped, and dotted.
Write a program to achieve the following:
The name of the type of fabric sold is entered as input into the program. This can be “plain”, “striped”, or “dotted”
This process continues until the employee enters "done"
The program then outputs the most popular type, and how many of those were entered. -- e.g. if four “plain”s were entered, the program would return “4 plain”.
Optional challenge add on (+2 marks)
(note: this is worth an extra 2 marks for those who would like to attempt it.)
If two/three types have the same count, then the program should print all two/three types and how many of each was entered-- e.g. "3 plain and dotted"
You’ll be marked on accuracy, efficiency and defensive programming.
I've done my solution - two questions: - Does it have to be written in pseudocode? (I have pseudocode and a working Python script done, can submit either) - Do we just... post our solutions as a public reply like this?
Hey there! Thanks for the message (you're amazing!). To answer your two questions: Yes, pseudocode/flowchart please, as those are the accepted algorithm forms in the HSC, and the purpose of this is to get extra practice for the HSC.
And yep, a public reply just the way you've done. Please enclose your pseudocode using the [ code ] [ /code ] tags (remove the spaces). Four spaces is an indent. If you want, you can also enclose it in the [ spoiler ] [ /spoiler ] tags, which will hide it until you click on it. :)
Title: Re: SDD Algorithm Contest (ALCON) | Week 1
Post by: JTrudeau on April 29, 2018, 12:59:37 pm
Fantastic, thank you for your entry! Please check back on Monday morning, when we'll release the feedback to this thread. :)
There is still time to submit your solution! Hope to see a couple more pop up!
Title: Re: SDD Algorithm Contest (ALCON) | Week 1
Post by: Opengangs on April 29, 2018, 11:02:18 pm
ALCON WEEK 1 FEEDBACK
Well done to anomalous who scored 5/7 (including 2 for the challenge). Fantastic start to their campaign. Remember that it's not too late if you didn't score any points now - there are heaps more coming your way with many varieties of algorithms, so stay tuned for those.
Everything you need for Week 1's problem can be found here. You can find your own entry and read the comments and feedback.
Title: Re: SDD Algorithm Contest (ALCON) | Problem 1: IKEO
Post by: jasn9776 on May 06, 2018, 10:00:54 pm
[code ] READ Input fabric1[0, plain] fabric2[0, striped] fabric3[0, dotted] fabricX[0, X] {make more modifiable} WHILE input =! done FOR i from 1 to X IF Input = fabric(i)(1) THEN fabric(i)(0) = fabric(i)(0) + 1 ENDIF NEXT i ENDWHILE
Most popular type: FindMax(Fabric1(0),Fabric2(0), Fabric3(0))
subroutine for find max FINDMAX(number1, number2, number3... X) currentmaxvalue = 0 FOR i = 0 to lengthofFINDMAX -1 IF FINDMAX(i) > FINDMAX(currentmaxvalue) THEN currentmaxvalue = i ENDIF Next i