Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


meaning of an english word

Posted on 2001-06-22
Medium Priority
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.

Question by:collinng
  • 2
  • 2
  • 2
  • +5

Expert Comment

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

Expert Comment

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.

Expert Comment

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.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 50

Expert Comment

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.

Accepted Solution

dkloes earned 200 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).
LVL 22

Expert Comment

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


else if(classcode==2)



LVL 50

Expert Comment

ID: 6221599

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

Expert Comment

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.


  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.

Expert Comment

ID: 6228840
Hope it was not for course in English. Or other language.

Expert Comment

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.

LVL 24

Expert Comment

ID: 6233466
;-) 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)

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Starting up a Project

575 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