cooldude16
04-19-2010, 12:48 AM
PLEASE HELP!!!!!! I have to write pseudocode for a program and I want to know if this looks correct?I am using VB
the problem is:
The camp keeps records for each camper including first name,last name, birthdate and skill scores ranging from 1 to 10 in 4 areas:tennis,crafts,swimming and horsemanship.the birthdate is stored in the format YYYYMMDD without punctuation.First name and last name should be 15 characters max.The camp wants a printed report listing each campers data and the sum of the 4 skill scores.Write the pseudocode.
so, did i do this right?
start
string lastName
string firstName
num birthdate
num totalSkillScore
string MAIN_HEADER="Campers Data"
string COLUMN_HEADERS
="First Name Last Name Birth Date Total Skill Score"
string lastFormat="15 characters MAX"
num swimScore
num tennisScore
num craftsScore
num horsemanshipScore
num birthdateFormat=YYYYMMDD
string ERROR_MSG="Invalid Format"
string ERROR_MSG2="Invalid Number"
print MAIN_HEADER
print COLUMN_HEADERS
print"last name and first name =15 characters max, birthdate = YYYMMDD"
print"Enter skill score from 1 to 10"
get lastName,firstName,birthDate,swimScore,tennisScore,craftsScore,horsemanshipScore
while not eof
If birthDate=birthDateFormat then
If lastName=lastFormat then
If firstName=lastFormat then
If(horsemanshipScore>=1AND<=10)AND(tennisScore>=1AND<=10)AND(craftsScore>=1AND<=10)AND
(swimScore>=1ANd<=10?then
totalSKillScore=horsemanshipScore+tennisScore+craftsScore+swimScore
else
print ERROR_MSG2
else
print ERROR_MSG
else
print ERROR_MSG
else
print ERROR_MSG
endif
print firstName,lastName,birthDate,totalSkillScore
get lastName,firstName,birthDate,swimScore,tennisScore,
craftsScore,horsemanshipScore
endwhile
stop
the thing is that I don't really know how to make sure the user enters the birthdate in the correct format[YYYYMMDD]or how to limit the number of characters in a name.
the problem is:
The camp keeps records for each camper including first name,last name, birthdate and skill scores ranging from 1 to 10 in 4 areas:tennis,crafts,swimming and horsemanship.the birthdate is stored in the format YYYYMMDD without punctuation.First name and last name should be 15 characters max.The camp wants a printed report listing each campers data and the sum of the 4 skill scores.Write the pseudocode.
so, did i do this right?
start
string lastName
string firstName
num birthdate
num totalSkillScore
string MAIN_HEADER="Campers Data"
string COLUMN_HEADERS
="First Name Last Name Birth Date Total Skill Score"
string lastFormat="15 characters MAX"
num swimScore
num tennisScore
num craftsScore
num horsemanshipScore
num birthdateFormat=YYYYMMDD
string ERROR_MSG="Invalid Format"
string ERROR_MSG2="Invalid Number"
print MAIN_HEADER
print COLUMN_HEADERS
print"last name and first name =15 characters max, birthdate = YYYMMDD"
print"Enter skill score from 1 to 10"
get lastName,firstName,birthDate,swimScore,tennisScore,craftsScore,horsemanshipScore
while not eof
If birthDate=birthDateFormat then
If lastName=lastFormat then
If firstName=lastFormat then
If(horsemanshipScore>=1AND<=10)AND(tennisScore>=1AND<=10)AND(craftsScore>=1AND<=10)AND
(swimScore>=1ANd<=10?then
totalSKillScore=horsemanshipScore+tennisScore+craftsScore+swimScore
else
print ERROR_MSG2
else
print ERROR_MSG
else
print ERROR_MSG
else
print ERROR_MSG
endif
print firstName,lastName,birthDate,totalSkillScore
get lastName,firstName,birthDate,swimScore,tennisScore,
craftsScore,horsemanshipScore
endwhile
stop
the thing is that I don't really know how to make sure the user enters the birthdate in the correct format[YYYYMMDD]or how to limit the number of characters in a name.