I want to create a method that is meant to protect against entering a wrong value for gender. The method **fineGender** below, will return true if the correct gender is entered and false otherwise. // postcondition: fineGender returns true if argument g equals M, m, F or f // and returns false otherwise. public static boolean fineGender(char g)

Member Avatar
Member Avatar
+0 forum 6

Hi guys. I'm just wondering why this function always returns true, no matter what the $user_id is. The $user_id variable is determined by what is retreived from the $_SESSION. I am well aware that mysql_* functions are being depreceated etc, no need to tell me :P Thanks guys! function user_mod() { $user_id = $_SESSION['user_id']; return (mysql_result(mysql_query("SELECT COUNT($user_id) FROM `users` WHERE `permissions` = 1 OR `permissions` = 2"), 0) == 1) ? true : false; }

Member Avatar
Member Avatar
+0 forum 3

Im doing a reservation site for a project. And Im trying to disable radio button(s) if the sql statement returns true. Example: User selects a date and a time, and radio button(s) would be disable depending on database. So far, I have this: $result=mysqli_query($mysqli,"SELECT tableselect FROM reserve WHERE reserveDate = '". $date ."' AND reserveTime = '". $time ."'"); if($row = $result->fetch_array(MYSQLI_ASSOC)){ echo $row['tableselect']; if($t){?> //WHAT MUST BE HERE? <?php } } Doing it on PHP, JQuery. Please help?

Member Avatar
Member Avatar
+0 forum 2

I need to know how to transfer /copy a true type data file from true type to text so that it can be read on a windows system. The font used is SERIF and does not transfer to windows as readable data. The font in windows can not read the file. I have ftp'd the file between the two systems.

Member Avatar
Member Avatar
+0 forum 1

I have this code, it's basically a program which I wrote, a 'Guess my number' game. The only problem is that I did something, and now I can't choose from my options anything else, that the first option. I put all my conditions in the while True loops, and now it won't let me choose anything else, just the first thing from the while. The same thing goes for the end of one level, meaning at the question "Redo", even thou I put the No answer it won't break, it will still get the first instruction to run, meaning the …

Member Avatar
Member Avatar
+0 forum 1

Hello, I am asking about true syntax of the following:: I have a class name P and in header file (of this class) ------> [CODE] class P { public: P(); ~P(); void addItem(const int newItem); void deleteItem(const int Item); void showAll(); /** need to proper getter funct. of tail */ private: struct Node { int item; Node *next; Node *precede; }; int size; Node *tail; }; [/CODE] Now I am asking that how I can write getter function of tail ? -class P will be used by another class. Thanks for replying.

Member Avatar
Member Avatar
+0 forum 4

Im stuck with the following: Define a function isPrime(number) that takes in a number as argument and return True if the number is a prime number. Hint: A number, x is a prime number if it is only divisible by 1 and x itself. By definition, 1 is not a prime number. [CODE] Examples >>> isPrime(97) True >>> isPrime(1) False >>> isPrime(-2) False [/CODE] [CODE] # Hint: Step through the range between (2, number-1), # and determine if the number is divisible using the modulus operator. def isPrime(x): [/CODE] how should i go about this? i dont understand it. Any …

Member Avatar
Member Avatar
+0 forum 5

the objective is to create a function to determine, from the three sides of a triangle, whether it is isosceles or not. I wrote the following code, yet its not very efficient, how could i have done this better? and is there anything wrong with this code? i tested it and it passed, but its a bit overly complicated for the task. [CODE] def isIsosceles(x, y, z): l = [x, y, z] for a in l: for b in l: if a <= 0: return False elif a == b: if x == y or x == z: return True …

Member Avatar
Member Avatar
+0 forum 10

hello this is my first C++ program my problem is that i cant find out to things frist is that when i rune it and sett the mathe type it is ignored laiter and hit shows alle offe the posbole mathe types ( that i have enterd +,-,/ and * ) secone prolem is that if i try to multiply or divid whitt 0 my system crashes, i see that it is a math problem for the pc or somthing butt i have no idd how to fix it. i was thing som sorrt of program that maksi it so …

Member Avatar
Member Avatar
+0 forum 2

so i'm created a program that display the name and grade of students from a file, and also a boolean that checks to see if the names are in alphabetical order. The problem is that i've created a files that has a name in alphabetical order but it still returns false [CODE]class Assignment { //------------------------------------------------------------------------------ public static void main (String [] args) throws Exception { Scanner kb = new Scanner(System.in); System.out.print("\nEnter name of a file of Students: "); String filename = kb.nextLine(); Section sec = new Section(filename); System.out.println("\nIn forward order:"); sec.print(System.out); System.out.println("\nhasNamesAscending() --> " + sec.hasNamesAscending()); } //------------------------------------------------------------------------------ } // …

Member Avatar
Member Avatar
+0 forum 2

The last time I was making a program, I wanted to input from user a boolean answer (to save space ;)) An input of 0/1 works good (0-false) and (1-true), but if the user inputs the boolean values as "true" and "false", it comes out to be an error. So, are there any ways of doing so.? I believe, that the strings "true" and "false" are defines using #define in the header files because of which the input is creating an error. Am i correct.?

Member Avatar
Member Avatar
+0 forum 5

hi, I m working on vs 2010. asp.net. i have problem with apply class using jquery. there is one textbox. i use class by this way its perfectly work. but when textbox multilink property is true. then problem is raise. pls help me to use this... thanks in advance. jack

Member Avatar
+0 forum 0

The End.