Thread: Grading Program Error

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    unleashed alphaoide's Avatar
    Join Date
    Sep 2003
    Posts
    696
    Code:
        do
        {
             getInput(student);
             displayRecord(student);
             student.percent = computePercent(student.totalpts, maxpts);  // student.totalpts is not initialized
    You may want to re-order your function calls
    Code:
        do
        {
             getInput(student);
             displayRecord(student);
             student.totalpts = computePointsEarned(student.quiz_1, student.quiz_2, student.midterm_score, student.final_score);
             student.percent = computePercent(student.totalpts, maxpts);
    Last edited by alphaoide; 05-08-2006 at 08:09 AM.
    source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 04:35 PM
  3. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM