oh yea you just reminded me i got a problem i cant figure out
i need to figure out how to make male and female counts go up respectively, does anyone have a solution with using the same syntax?Code:<?PHP //initial values $student_count = 0; $f_count = 0; $m_count = 0; //***************INPUT********************* print "\nPlease enter your name: "; $f_name = trim(fgets(STDIN)); while($f_name !="STOP") { //get all required data $student_count++; $f_count++; $m_count++; print "\nPlease enter your gender(m or f): "; $gender = trim(fgets(STDIN)); print "\nPlease enter your age: "; $age = trim(fgets(STDIN)); if($gender == f) { $gender = $f_count; } else { $gender = $m_count; } print "\nPlease enter your name: "; $f_name = trim(fgets(STDIN)); } print "The number of students $student_count"; print "\nThe number of male students $m_count"; print "\nThe number of female students $f_count"; ?>
Results 1 to 30 of 99
Hybrid View
-
full metal merchant
- Join Date
- Sep 2008
- Location
- i daer you to make it out of ferguson alive
- Posts
- 19,583
08-12-2012*call centre crew*
*hate talking to people crew*
*get abused for a living crew*
*sexually harassed by hot women crew*
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)






