Solved

for loop

Posted on 1998-02-17
6
206 Views
Last Modified: 2010-04-02
I am a student learning C now, I was given a homework . I spent 3 whole days on it but i still  could not figure out. this program is about to write 3-D arrays, class, student and quizz, after input 27 grades, this program should print out the average as follwing:

class1
the average for student 1 is XX
the average for student 2 is XX
the average for stident 3 is XX

class2
the average for student 1 is XX
 :    :           :     2   :
 :    :           :         :
class 3
 :    :

The average in class 1 is XX
:     :         :    2   :
:               :    3   :

the total average  for all classes is XX


My problem is that I could not do this printout loop and average, I appreciate if you could show me how to do it without using function call.

thank in advance

Keqin Mao
My instructor did not teach us too much about array, and our textbook is not good for reference.
0
Comment
Question by:kemao
  • 3
  • 2
6 Comments
 
LVL 3

Accepted Solution

by:
q2guo earned 200 total points
ID: 1257294
Can you email me the exact question please?
my email is q2data@yahoo.com.
I will get back to you in one hour.
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1257295
Not very kind: as an expert, you should know the difference between comments and answers, shouldn't you?
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1257296
Sorry, but nowdays to get some points,  this is what you have
to do.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Expert Comment

by:rsjetty
ID: 1257297
Yes , your this can be done very easily. All it requires is simple set of for loops.
My assumption is that we know the No of Students , No of Classes and No of Quizes before hand.
Your total report consists of three individual reports , which are
(1)Average of each student grouped by class
(2)Average of each class
(3)Average of all the classes
Each of the above mentioned reports requires 3 "for" loops , nested within each other.Thus you require 9 "for" loops in all.
for more info get back to me.- rsjetty
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1257298
q2guo

i'm not a policeman, so take the following as just my opinion:

i do appreciate your sincerity, but please keep in mind that, first, you locked a question without an answer, second, you asked for direct contact via e-mail; both actions are violations of the expected experts' behaviour; if you keep acting this way, you will find yourself alone.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1257299
Julio
I will try not to let this happen again.
Sorry, if I made some people unhappy.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now