Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,211 members, 7,818,719 topics. Date: Sunday, 05 May 2024 at 10:45 PM

Plz Help With Using Pseudo Code For This Algorithm - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Plz Help With Using Pseudo Code For This Algorithm (1505 Views)

Please What Is This Algorithm That Compares............ / Try This Algorithm Question. / Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) (2) (3) (4)

(1) (Reply) (Go Down)

Plz Help With Using Pseudo Code For This Algorithm by jt2010: 3:10pm On Aug 25, 2011
Bleep
Re: Plz Help With Using Pseudo Code For This Algorithm by Fayimora(m): 3:25pm On Aug 25, 2011
looks like its your assignment so take it step by step! Have you written a program that keeps asking 1 person what flavour he/she would like?
Re: Plz Help With Using Pseudo Code For This Algorithm by farouqzaib: 3:43pm On Aug 25, 2011
@OP, The answer is staring right back @ u. I agree with Fayimora, you can post what you've gotten so far and the guys'll help.
Cheers.
Re: Plz Help With Using Pseudo Code For This Algorithm by jt2010: 6:02pm On Aug 25, 2011
Yes, it is my class assignment and am new to programming thus experience in Netorking and switching but am not familar with this Pseudo coding things, i just need ideas of what to do. Please give tips to help me start something
Re: Plz Help With Using Pseudo Code For This Algorithm by Fayimora(m): 2:13am On Aug 26, 2011
Are you supposed to write a program that performs the actual task or you are just mean to submit algorithm that can be implemented!
Re: Plz Help With Using Pseudo Code For This Algorithm by jt2010: 7:45am On Aug 26, 2011
just to submit an algorithm in Pseudo cofe that can be implement this scenario.
Re: Plz Help With Using Pseudo Code For This Algorithm by Fayimora(m): 1:39am On Aug 27, 2011
Sent you an initial email: my first shot;

    students = array_to_hold_students
options = array_to_hold_options
boolean done = true or false if there is a next question

questions = array_to_hold_questions,
result = map_to_hold_questions_and_their_answers

while done is_false
choose question_random_number
select a question at random using the question_random_number
Output: Print out question
Input: retrieve answer to question
save the question and answer into the map

Input: true or false(whether or not the program should re-run)

if input is true
done is_true
goto: 8
else if input is_false
Output: Bye message
exit program

There is a lot i havent considered but am just giving you this so you can start doing something yourself. Would post another version in bout 10 minutes. also, you can make it more ~'pseudo-codeish'
Re: Plz Help With Using Pseudo Code For This Algorithm by Fayimora(m): 1:47am On Aug 27, 2011
Here is another version:


students = array_to_hold_students
options = array_to_hold_types_of_iceream_available
boolean done = true or false if there is a next question

questions = array_to_hold_questions,
result = map_to_hold_questions_and_their_answers

while done is_false
choose question_random_number
select a question at random using the question_random_number

Output: Print out question

generate student_random_number
select a student at random using student_random_number

Input: retrieve answer to question
boolean valid = validate_input(answer)

if valid is_true
save the question and answer into the map

Input: true or false(whether or not the program should re-run)

if input is true
done is_true
goto: 8
else if input is_false
Output: Bye message
exit program


function boolean validate_input(answer)
for each option
if answer is an option
return true

return false

Re: Plz Help With Using Pseudo Code For This Algorithm by Fayimora(m): 1:51am On Aug 27, 2011
Here is something else:

students = array_to_hold_students
options = array_to_hold_types_of_iceream_available
boolean done = true or false if there is a next question
constant MAX = number_of_times_questions_would_be_asked
questions = array_to_hold_questions,
result = map_to_hold_questions_and_their_answers
Integer counter =0;

chances -> generate random number between 1 and MAX

while counter is not equals to chances
choose question_random_number
select a question at random using the question_random_number

Output: Print out question

generate student_random_number
select a student at random using student_random_number

Input: retrieve answer to question
boolean valid = validate_input(answer)

if valid is_true
save the question and answer into the map
else
Output: error message

goto: 11
counter = counter + 1

end while

Output: result
Output: Bye message
exit program


function boolean validate_input(answer)
for each option
if answer is an option
return true
end for
return false
end validate_input


Ok i think am getting tired of this thing! Anyways you can edit as you like. By now i assume you already get whats happening. Also be careful with the indentation as its matters, a lot.
Re: Plz Help With Using Pseudo Code For This Algorithm by Nobody: 7:25pm On Aug 27, 2011
OK Removed
Re: Plz Help With Using Pseudo Code For This Algorithm by Fayimora(m): 7:32pm On Aug 27, 2011
I think you replied to the wrong topic!

(1) (Reply)

Networking Vs Programming / Need Help With Server-side Script / Learning Structure In Andela 4year Program

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.