Solved

meaning of an english word

Posted on 2001-06-22
11
227 Views
Last Modified: 2010-04-17
Hi, i am interpreting a question for someone, and what is the meaning of 'safe assumption' ? Any guess ?

THe question is here below :

 
Write a Pseudocode which read a file containing the name, classcode, and GPA of each student in a class. A classcode of 1 means Freshman, and a classcode of 2 means Sophomore. Write out the name, class name (freshman sophomore), and GPA for each input record. This Pseudocode should be written in 2 different modules.

a)  Assume that it is a safe assumption
b)  Rewrite the Pseudocode when that is not a safe assumption
c)  Rewrite the Pseudocode for which an error message is desired.

0
Comment
Question by:collinng
  • 2
  • 2
  • 2
  • +5
11 Comments
 
LVL 4

Expert Comment

by:prashant_n_mhatre
ID: 6220033
Nice question...I'll get back to see responses....
0
 
LVL 16

Expert Comment

by:imladris
ID: 6220043
Hmmm. Safe assumption in and of itself refers to an assumption that is overwhelming likely to be correct. I'm a bit puzzled however, in that the text you provide doesn't list what, or about what, one should be assuming anything......

An example might be the existence of the file. You could write code in which the existence of the file is a safe assumption.
On the other hand you could write code, in which you should not assume that the file exists, and so you have to check for that first, and provide error message in the case where it doesn't.
0
 
LVL 1

Expert Comment

by:dkloes
ID: 6220567
I agree that the question is lacking in information.  It is almost as if the questioner has defined the term "safe assumption" in a particular way for the students.  A safe assumption would most likely be that each student record does have a valid classcode of 1 or 2.  The pseudocode would be different if you did not assume this.
0
 
LVL 47

Expert Comment

by:dbrunton
ID: 6221028
Check with tutor.

I'll presume that the safe assumption is that the classcode will always be 1 or 2 and no variations can occur.
0
 
LVL 1

Accepted Solution

by:
dkloes earned 50 total points
ID: 6221160
To be perfectly safe, "a" would assume a valid classcode of 1 or 2 and that the file exists, "b" would not make these assumptions, and "c" could produce error messages for an invalid classcode or for a failure to open the file as suggested by imladris.  It would also be possible to have and error on the name (missing for example) and GPA (not numeric).
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 22

Expert Comment

by:CJ_S
ID: 6221214
Example: A safe assumption is that a boolean can either hold true or false.

Even an else statement is a safe assumption. In your example it would mean that the classcode can be either 1 or 2. To complete it you add an else statement

if(classcode==1)
{

}
else if(classcode==2)
{

}
else
{

}

Regards,
CJ
0
 
LVL 47

Expert Comment

by:dbrunton
ID: 6221599
Hmm.

Missed your posting dkloes cause I duplicated what was in your post.
0
 
LVL 24

Expert Comment

by:SunBow
ID: 6226002
Is it 'safe to assume' that all students are accounted for, and that each of three fields is already spelled out correctly? And that there are no other fields of information such as student ID#?:

> "containing the name, classcode, and GPA of each student"

Names can be mispelled, "1" can be a number, a letter representing a number, visually similar (like 0 & O, 1 & l), fields may be default, blank, null, invalid, or erroneously typed or typed.

Your question "c" gives a main clue, that this is mainly about checking for errors or not, and if errors are found, will then be done. Hasty code, whether pseudocode or not, may not check for error conditions in many different areas, 'assuming' there is no need to.

Consider, that in another program, "3" means Junior and "4" means Senior. So a table lookup could return, could retrieve, twice the possibilities. Yet lookup/translation on "classcode of 1" is different from that for "classcode of 4" which is different from that for "classcode of 6". While latter two are erroneous, they may yield different progammatic results.

Consider code like:
  if "classcode of 1" then student is a freshman, otherwise student is a sophomore.

           or

  all students are sophomore (level), but if "classcode is 1" then call student a freshman anyway.

Now you do not need more than one condition, leading to binary or even boolean possibilities.

Now consider situation where class had three graders. One graded on four point scale. One on five point scale. One called in sick (no input). One student was graded by both graders.

Is it safe to assume anything about the content of any field of data? Suppose one grader used excel, leaving GPA as a number, and other grader used MS-Word, leaving GPA as alphabetic.

What is it "safe to assume"? Is there exactly one record per student? Exactly one student per record? That is often assumed.

Class exercises are sanitized compared to real world. What sounds so simple at first, checking for error(s) or not, can have several levels of complexity. Some code translaters, for example, behave differently for traditional 'if-then-else' when other conditions arise concerning erroneous data, leading to supposed boolean  results of true, false, invalid, error, incomplete, ... (etc.).

;) You do know the old saying, do you not, that
"When you 'assume'  "
you make an
"________________"

Why three steps, a-b-c? Like imladris and the file. Consider step c)
Is it safe to assume that there is I/O device, monitor, printer, file, etc. that is available to use for producing the error message that is desired?

(a trick question?  naw, i doubt)

Generally, better documentation will state up front in the code commentary just what is or is not... safely assumed.
0
 
LVL 4

Expert Comment

by:MobileOakAI
ID: 6228840
Hope it was not for course in English. Or other language.
0
 
LVL 3

Expert Comment

by:Fenman
ID: 6231130
In the context of a teaching environment, a 'safe assumption' generally refers to assuming that all data is valid with no errors.

That is, each record that is read will have correct data for each reference item such as classcode will always be a valid classcode.

So part 1 is assume all data supplied is valid.
Part 2 is assume can have invalid data so include error trapping.
Part 3 is include error messages to part 2.

Cheers
0
 
LVL 24

Expert Comment

by:SunBow
ID: 6233466
ditto
;-) actually, the main assumption is the test or exercise does not care about reality and is limited in focus and scope, so trick is to identify the goal that they are trying to achieve, and to do it simple and elegantly. They have not the time for handling complexities, hence, their common use of this 'safe assumption' which helps most to retain focus.

Although on occasion... one may get extra credit for a little more, it does not pay to either confuse a grader or make them feel inferior (I achieved both ends of scale rather successfully)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

759 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

20 Experts available now in Live!

Get 1:1 Help Now