GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 01-Oct-2006, 21:06
cristale10 cristale10 is offline
New Member
 
Join Date: Oct 2006
Posts: 10
cristale10 is on a distinguished road

Having Problems with Loops


I have to create a program that utilizes nested loops, sentinel and EOF loops. The program must find the maximum, minimum, and average of five class sections. The sentinel loop is a negative number (-1). The outer loop is an EOF loop, which should calculate the total arverage (average of the averges for each line). Each line should be a class section which contains a leading zero. The professor stated that string should be used to get the leading zero. Why can't the zero just be typed in? A hard copy of the C++ code, a hard copy of the output, and a disk with the source code must be turned in. What is the difference in the C++ code and the source code?
  #2  
Old 02-Oct-2006, 13:20
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,373
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: Having Problems with Loops


Quote:
Originally Posted by cristale10
Each line should be a class section which contains a leading zero. The professor stated that string should be used to get the leading zero. Why can't the zero just be typed in?
Typed in from where? The file? By definition of the problem, "Each line should be a class section which contains a leading zero" so the number must have a leading 0. If it doesn't, I assume there is an error. If you read the value as a number, you have no idea whether there was a leading 0 or not, therefore reading the number as a string is the only way to know for sure.

Quote:
Originally Posted by cristale10
What is the difference in the C++ code and the source code?
No difference. Two terms for the same thing.
__________________

The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
  #3  
Old 02-Oct-2006, 14:58
cristale10 cristale10 is offline
New Member
 
Join Date: Oct 2006
Posts: 10
cristale10 is on a distinguished road

Re: Having Problems with Loops


Thank you for the clarity.
 
 

Recent GIDBlogProblems with the Navy (Enlisted) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems while burning CD's netnut Computer Software Forum - Windows 16 17-Jan-2008 23:45
nested for loops sandeepeecs C Programming Language 3 20-Aug-2006 08:49
Help with nested for loops...please. sorry newbie keperry C++ Forum 14 16-Oct-2004 11:25
Help using nested for loops dontcare C++ Forum 1 03-Oct-2004 12:33
Chaintech Geforce 5600 FX problems bartster74 Computer Hardware Forum 8 04-May-2004 13:16

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 00:44.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.