Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 6th, 2005, 01:43 AM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Design help for beginner

I'm very new at programming and am trying to teach myself how to do some basic things. However, I do not know how to attack this problem very well beyond some basic outlines. Could someone create a skeleton of this problem for me? I need to create a few functions to use within the program, as well as set up arrays to hold the "grades" for the students. I realize this is way too much to ask, but I'd appreciate any aid I may receive. If nothing else, please help me understand how to use an array in this situation.


 Write a program that will read in a file of data which contains the results of students taking a math exam. Your program will report the score and grade of each student as well as do some item analysis on the questions.

The answers are in the form of floating point numbers which represent the answer the student wrote down. The format of the data file is:

    * The very first line of the file will contain an integer which is the number of questions on each test. This number will be positive and no larger than 100. There will also be a floating point number on the same line, which represents a range. This is described below. The numbers are delimited by whitespace.
    * The second line of the file should contain the word KEY. Then the next (third) line will have the correct answers for the test. If the key is not found, your program should announce the fact and stop immediately.
    * The next lines will be in pairs. The name of the student (may have spaces in it) will be on one line and the student's answers will be on the next line. There may be ANY number of students in the file.

The program should ask the user for the name of the data file with the data to be processed in it. As usual, if the file does not exist, that fact is announced and the program stops.

The range represents the fact that the teacher is allowing for small errors in calculation in the students' work. If the key says the correct answer is 8.1 and the range is 0.1, the program should accept numbers from 8.0 to 8.2. The range will be a single number, it applies to all the answers on the test.

The term item analysis means to keep a count of how many times each question is missed. This can range from 0 (everyone got it right) to the number of students (everyone missed it). The tests are scored with each question worth one point. The score of each student is how many questions they got right. The average is calculated as the sum of the scores divided by the number of students. Be careful not to divide by zero. If zero students are processed, what's a reasonable value for the average?

Your program should also report the letter grade for individual students. The grading scale is the usual one,

    * 90-100% = A
    * 80 up to 90% = B
    * 70 up to 80% = C
    * 60 up to 70% = D
    * below 60% = E

Sample interaction with the user:

Enter file name: testdata

testdata processed.

The input file for this is called testdata:

10 0.1
KEY
1.0 2.0 3.5 4.4 5.5 6.6 7.7 8.0 9.0 123.4
John Smith
1.0 2.1 3.4 4.4 4.5 7.7 7.7 8.1 9.0 123.4
Ralph Johnson
1.0 2.0 3.5 4.4 5.5 6.6 7.7 8.0 9.0 123.4
close student
1.1 2.1 3.6 4.3 5.4 6.5 7.6 7.9 8.9 123.3
another student
0.9 4.1 3.2 5.92 7.34 6.7 8.1 8.0 9.0 123.5
yet another student
0.9 4.1 3.2 5.92 7.34 6.7 8.1 8.0 9.0 123.5
Missed them all
0.5 4.1 3.2 5.92 7.34 6.9 8.1 8.5 9.2 143.5

The program creates an output file of testdata.out:

For 6 students
Number of questions 10
The range allowed for answers was 0.1
Student Average = 63 %
The largest score was 10
The smallest score was 0

Item Analysis

Question # # Missed
  1 1 | *
  2 3 | *
  3 3 | *
  4 3 | *
  5 4 | *
  6 2 | *
  7 3 | *
  8 1 | *
  9 1 | *
 10 1 | *


The program also produces an output file called "testdata.grades" that contains student names, scores and letter grades. Its format is kept very plain in case it will be used as input to another program.

John Smith
8 B
Ralph Johnson
10 A
close student
10 A
another student
5 E
yet another student
5 E
Missed them all
0 E

Functions you must write:

    * a void function called drawgraph that produces the graph part of the output, 2 parameters
    * a char function called lettergrade that returns the letter grade that corresponds to a given score on the test, 2 parameters
    * a void function called getanswers that returns the name of the student and the answers given by that student, 4 parameters

The number of parameters for each function is not cast in stone, but it should give you an idea of how many to have.


Reply With Quote
  #2 (permalink)  
Old December 6th, 2005, 03:01 AM
Authorized User
 
Join Date: Nov 2005
Location: , , India.
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

and u expect us to read all this

Reply With Quote
  #3 (permalink)  
Old December 6th, 2005, 09:09 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nope, and I explained this in the first paragraph.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A beginner who needs need help Jamesbizprocom Beginning PHP 1 June 28th, 2007 11:02 PM
Design patterns for web design ceadge HTML Code Clinic 0 June 19th, 2006 11:26 AM
Java Design issue with UML and Design Patterns the_logical_way Apache Tomcat 0 May 31st, 2004 04:02 AM
Beginner programmed XML 3 February 21st, 2004 05:12 AM
Beginner acko ADO.NET 1 October 27th, 2003 08:23 AM



All times are GMT -4. The time now is 08:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.