All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic
The Exam (Posted on 2023-08-31) Difficulty: 3 of 5
Five students Adele, Betty,Carol, Doris, and Ellen- answered five questions on an exam consisting of two multiple-choice (a,b,c) questions and three true-or-false questions.

(1) They answered the questions as follows:

       I     II.    III.    IV.     V
Adele. a      a      t       t      t
Betty. b      b      t       f      t
Carol. a      b      t       t      f
Doris. b      c      t       t      f
Ellen. c      a      f       t      t
(2) No two students got the same number of correct answers.
Who got the most correct answers?

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution | Comment 1 of 5
Doris got the most correct answers.

The correct answers are bctff
The scores are [1, 3, 2, 4, 0]
Doris achieved the highest score of 4

names = ['Adele','Betty','Carol','Doris','Ellen']
students = ['aattt','bbtft','abttf','bcttf','caftt']
answers = []
for v in ['a','b','c']:
    for w in ['a','b','c']:
        for x in ['t','f']:
            for y in ['t','f']:
                for z in ['t','f']:

def matches(r,s):
    """ for 2 strings, r and s, how many spots with the same character? """
    if len(r) != len(s):
        print('not the same length')
        return None
    same = 0
    for i,v in enumerate(r):
        if r[i] == s[i]:
            same += 1
    return same

correctanswers = []
correctscores = []
for answer in answers:
    scores = []
    for student in students:
    if len(set(scores)) == 5:

if len(correctanswers) == 1:
    print('The correct answers are', correctanswers[0])
    print('The scores are', correctscores[0])
    highestscore = max(correctscores[0])
    print( names[ correctscores[0].index(highestscore) ] ,'achieved the highest score of', highestscore )
  Posted by Larry on 2023-08-31 08:47:44
Please log in:
Remember me:
Sign up! | Forgot password

Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Copyright © 2002 - 2023 by Animus Pactum Consulting. All rights reserved. Privacy Information