Exforsys

Online Training

i Need help with this program plzzzz

This is a discussion on i Need help with this program plzzzz within the C and C++ forums, part of the Programming Talk category; Use structure to hold a candidate’s data. A multiple-choice examination consists of twenty-five questions. Each question has ...


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-10-2007, 08:01 AM
Junior Member
 
Join Date: Dec 2007
Posts: 2
Snash is on a distinguished road
i Need help with this program plzzzz

Use structure to hold a candidate’s data.
A multiple-choice examination consists of twenty-five questions. Each question has five choices, labeled A, B, C, D and E. The first line of data contains the correct answers to the twenty-five questions in the first 25 consecutive character positions, for example:

ABCDABCDABCDABCDABCDABCDA
Each subsequent line contains the answers for a candidate. Data on a line consists of a candidate number (an integer), followed by one or more spaces, followed by the twenty five answers given by the candidate in the next twenty five consecutive character positions. A space is used if a candidate did not answer a particular question. You may assume all data are valid and stored in a file exam.txt. A sample line is:

N0001 ABCDABCDABCDABCDAB DABCDA

There are at most 30 candidates. A line containing a “candidate number” 0 only indicates the end of the data.

Points for a question are awarded as follows: correct answer: 5 points; wrong answer: 0 points; no answer: 0 points.

Write a program using the below input to process the data and print a report consisting of candidate number and the total points obtained by the candidate, in descending order by candidate number. At the end, print the average number of points gained by the candidates. You must use at least two functions: one to print the results and one to calculate the total points.

N0000 ABCDABCDABCDABCDABCDABCDA
N0001 ABCDBACDCDABABDC DCDABCDD
N0010 ABDCBBCDAD C BDDBDCBADCAA
N0011 ABCDABCDABCDABCDABCDABCDA
N0100 ABCDABC ABCDA CDABCDABCDA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-15-2004 07:00 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-01-2004 07:01 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit Tech FAQ 0 06-01-2004 07:00 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 05-15-2004 07:00 AM
Apple II Csa2 FAQs: Telecom Hardware & Transfers, Part 20/25 rubywand@swbell.net Tech FAQ 0 04-04-2004 08:29 AM


All times are GMT -4. The time now is 03:47 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.