Programming Help

Post » Sun Sep 26, 2010 11:57 pm

In my computer science class we are doing a compression exercise of a person age grade gender and gpa in an unsigned 16 bit integer.

? Least six significant digit represent GPA, where 100100 (3610)represents a GPA of 3.6 (36/10).
? Bit 7 is used to represent gender, where a 0 is ‘F’ and a 1 is ‘M’.
? Bits 11-8 are used to represent the student’s grade.
? Bits 16-12 are used to represent students’s age.

Under this scheme, the binary number 0110110001100110 represents a student who is 13 years old, is in the 8h grade, male and has a GPA of 3.8 (38/10).

I have everything done but the gender part because gender is Mm/Ff and I can't figure out how to take a text input. I just need that and if gender = M or m then I just need to add 64 to the encoded number.
User avatar
Chase McAbee
 
Posts: 3315
Joined: Sat Sep 08, 2007 5:59 am

Post » Sun Sep 26, 2010 2:36 pm

http://www.gamesas.com/index.php?/topic/1123394-unofficial-programming-thread-ii/

For future problems.
User avatar
Jennifer May
 
Posts: 3376
Joined: Thu Aug 16, 2007 3:51 pm

Post » Sun Sep 26, 2010 12:28 pm

I can't get this new search figured out. I searched but I only somehow found the old closed one.
User avatar
Kyra
 
Posts: 3365
Joined: Mon Jan 29, 2007 8:24 am

Post » Mon Sep 27, 2010 1:24 am

Closed as requested. Glad you figured it out. :)
User avatar
Stu Clarke
 
Posts: 3326
Joined: Fri Jun 22, 2007 1:45 pm


Return to Othor Games