| | |
Help with Arrays needed!
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2004
Posts: 1
Reputation:
Solved Threads: 0
Hello Everyone,
I am very new to C++ and have a program due this Wednesday. I would appreciate any help on this. I have written the pseudocode for the program but do not know if it is correct or how to write the actual code for it.
-------------------------
The program needs to do the folowing:
The experiment is to test students in a variety of math questions. Each exam has ten (10) True/False questions and four (4) problems. Students are know only by their ID number. Need to correct a score tracking system that will allow the user to track scores by exam and student. In addition the user wants to be able to rank students by total grade with highest score listed first. All questions are scored (Not actually asking the question, just asking for the answer). When scoring, the correct answers are entered first and identified by the ID 999. The students scores are then entered. Any negative ID will end grade entering. For the True/False, "1 = True" and "0 = False". Any other entry should not be accepted. The four problems can have any numeric answer (best to keep it either 1 or 0). The True/False answers equal 40% of the grade and the problem answers equal 60%.
User than wants a report to see which students have a score above 90% as he will be considered for honors math. Also, wants a report to know which students are receiving less than 60% as that user will be considered for basic math. A report should be printed for each students answer to each quest, the correct answer, each score to each question and the total score for the exam. If the score is at leat 90% or less than 60% a note should be added to see the departement chairman. Finally, a report should be prepared for each student identifying the student's name, results for each question and the total score.
--------------------------
This is what I have written, but do not KNOW how to code it.
----------------------------------------------------
There will be 2 multiple arrays
1. ArrayTestQuestions[x][15]
2. ArrayTestScores[x][2] where x is # of students
1. Collect test scores:
Front end:
Type in ID and then answers (1-14)
Back end:
x = 1;
Do While id > 0
if id = 999
{ ATQ[0][0] =
for i = 1 to 14
ATQ[0][i] =
}
else
{
ATQ[x][0] =
for j = 1 to 14
ATQ[x][j] =
}
x++;
End While loop
2. Do the arithmetic and get the total scores
For x = 0 to numstudents
{
score = 0
for i = 1 to 10
{
if ATQ[x][i] = ATQ [0][i]
score = score + 4
}
for j = 11 to 14
{
if ATQ[x][j] = ATQ [0][j]
score = score + 15
}
ArrayScore[x][0] = ATQ[x][0]
ArrayScore[x][1] = score;
}
3. Reports
Create two 1 dimensional arrays:
ArrayHonors[]
ArrayBasic[]
a. Sort Algorithm on ATQ to order from high to low
b.
i = 0; j = 0;
for x = 1 to NumStudends
{
if ArrayScore[x][1] > = 90
{
ArrayHonors[i] = ArrayScores[x][0]
i++
}
if ArrayScore[x][i] <= 60
{
ArrayBasic[j] = ArrayScores[x][0]
j++
}
}
c. printing reports
for x = 1 to numstudents
{
for i = 1 to 14
{
Print ATQ[x][i], ATQ[0][i]
}
Print ArrayScore[x][1]
if ArrayScore[x][1] >= 90 or ArrayScore[x][1] <= 60
print "See Department Chairman"
}
------------------------------------
Any help would be greatly appreciated.
Thank you
I am very new to C++ and have a program due this Wednesday. I would appreciate any help on this. I have written the pseudocode for the program but do not know if it is correct or how to write the actual code for it.
-------------------------
The program needs to do the folowing:
The experiment is to test students in a variety of math questions. Each exam has ten (10) True/False questions and four (4) problems. Students are know only by their ID number. Need to correct a score tracking system that will allow the user to track scores by exam and student. In addition the user wants to be able to rank students by total grade with highest score listed first. All questions are scored (Not actually asking the question, just asking for the answer). When scoring, the correct answers are entered first and identified by the ID 999. The students scores are then entered. Any negative ID will end grade entering. For the True/False, "1 = True" and "0 = False". Any other entry should not be accepted. The four problems can have any numeric answer (best to keep it either 1 or 0). The True/False answers equal 40% of the grade and the problem answers equal 60%.
User than wants a report to see which students have a score above 90% as he will be considered for honors math. Also, wants a report to know which students are receiving less than 60% as that user will be considered for basic math. A report should be printed for each students answer to each quest, the correct answer, each score to each question and the total score for the exam. If the score is at leat 90% or less than 60% a note should be added to see the departement chairman. Finally, a report should be prepared for each student identifying the student's name, results for each question and the total score.
--------------------------
This is what I have written, but do not KNOW how to code it.
----------------------------------------------------
There will be 2 multiple arrays
1. ArrayTestQuestions[x][15]
2. ArrayTestScores[x][2] where x is # of students
1. Collect test scores:
Front end:
Type in ID and then answers (1-14)
Back end:
x = 1;
Do While id > 0
if id = 999
{ ATQ[0][0] =
for i = 1 to 14
ATQ[0][i] =
}
else
{
ATQ[x][0] =
for j = 1 to 14
ATQ[x][j] =
}
x++;
End While loop
2. Do the arithmetic and get the total scores
For x = 0 to numstudents
{
score = 0
for i = 1 to 10
{
if ATQ[x][i] = ATQ [0][i]
score = score + 4
}
for j = 11 to 14
{
if ATQ[x][j] = ATQ [0][j]
score = score + 15
}
ArrayScore[x][0] = ATQ[x][0]
ArrayScore[x][1] = score;
}
3. Reports
Create two 1 dimensional arrays:
ArrayHonors[]
ArrayBasic[]
a. Sort Algorithm on ATQ to order from high to low
b.
i = 0; j = 0;
for x = 1 to NumStudends
{
if ArrayScore[x][1] > = 90
{
ArrayHonors[i] = ArrayScores[x][0]
i++
}
if ArrayScore[x][i] <= 60
{
ArrayBasic[j] = ArrayScores[x][0]
j++
}
}
c. printing reports
for x = 1 to numstudents
{
for i = 1 to 14
{
Print ATQ[x][i], ATQ[0][i]
}
Print ArrayScore[x][1]
if ArrayScore[x][1] >= 90 or ArrayScore[x][1] <= 60
print "See Department Chairman"
}
------------------------------------
Any help would be greatly appreciated.
Thank you
![]() |
Similar Threads
- help with loop (C++)
- Concactinating Multiple Text Files Into One (Java)
- SQL TimeStamp in DataViewGrid (C#)
- problem seperating string into individual letters. (C++)
- Homework Help. (C++)
- help with parrallel arrays (C++)
- Can't figure out this seg fault (C++)
Other Threads in the C++ Forum
- Previous Thread: C++ Builder 6 and TCppWebBrowser
- Next Thread: help regarding 2d arrays
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream input int integer java lib linux list loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree url vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





