GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Programming  >  C++
Go To First  |  Previous Question  |  Next Question 
 C++  |  Question 109 of 183    Print  
Suppose there is a txt file with following format:

Student name Grades in subjects
X ABA+CDA+
Y B+CAA+AA

there can be many students with there grades in various subjects.
(number of subjects are unknown)
Possible values of grade are: A, A+, B, B+, C, D

now suppose the file gets corrupted and all '+' are replaced by 'A'

Write a program to restore the file


  
Total Answers and Comments: 2 Last Update: June 18, 2008     Asked by: smart_coder 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 23, 2007 03:05:20   #1  
Indrajit        

RE: Suppose there is a txt file with following format:...
Since the number of subject for a perticular student is unknown and A is a valid grade, If a + symbol is replaced by a A then it would be impossible to find out without any other correct source of the same student's grades that the "A" there is occuring by mistake.

Hence it is impossible to write the programm.

 
Is this answer useful? Yes | No
June 18, 2008 09:44:56   #2  
chiyuwang Member Since: June 2008   Contribution: 4    

RE: Suppose there is a txt file with following format:Student name Grades in subjectsX ABA+CDA+Y B+CAA+AAthere can be many students with there grades in variou
agree
 
Is this answer useful? Yes | No

 Related Questions

 A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually 
Latest Answer :    A virtual function allows derived classes to replace the implementation provided by the base class. ...

"Poly" means "many" and "morph" means "form". Polymorphism is the ability of an object (or reference) to assume (be replaced by) or become many different forms 
Latest Answer : Polymorphism is "acquiring many forms". as it has been stated that c++ has the property of polymorphism.Like as someone said the eg of vehicle...it can be said that the particular operation can acquire one or many forms ...

 Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.  Ø      A Class 
Latest Answer : Class is a combination of data member & member function where object is used for calling function In class we declare In object we call ...

The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, 
Latest Answer : free() - releases the memory of the pointer passed as parameter, to the OS/application consumption. Using the pointer after free() will result in undefinded resultsrealloc() - used to resize the memory held by the pointer to the number of bytes specificed. ...

  Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This 
Latest Answer : The C++ compiler identifies a function by its signature (function signature). The function signature is broken down into the following components in that order.The parameter list ...

Virtual destructors: If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching 
Latest Answer : Virtual constructor is not build-in C++ feature but it doesn't mean its not used by devs in code and in conversations. There are many other things that doesn't exist in particular language yet, people find ways around to solve it (SingleTon, Virtual Constructor, ...

Latest Answer : if the solution is needed for the unix platform. Then you can create a pthread at the bottom of the program, take the current process id of the parent and make it a deamon by using the standard unix calls like detach(), chdir().. etc. Check if the parent ...
Read Answers (3) | Asked by : suji

Latest Answer : No, we cannot generate a c++ source code from the binary file bcoz we can compile highlevel language to lowlevel language but not lowlevel language to highlevel languageMoparthi Aravind ...
Read Answers (3) | Asked by : suji

What will be output of the following code#includeusing namespace std;class abc{ public : void main() { cout
Read Answers (5) | Asked by : Avaited

How is static variable stored in the memory?( if there are 2 functions in a file,and the static variable name is same (ex var) in both the function. how is it keep seperately in the memory).


 Sponsored Links

 
Related Articles

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

What is Data File

In a logical data model, the conceptual data model which is based on the business semantic is being defined. Thus, entities and relationships and corresponding table and column design, object oriented classes, and XML tags, among other things are being laid regardless of the database will be physica
 

How to develop compile and run a C program

The steps involved in building a C program are: 1. First program is created by using any text editor and the file is stored with extension as .c 2. Next the program is compiled. There are many compilers available like GNU C compiler called as gcc, Sun compiler, Borland compiler which is pop
 

What are the Format Specifiers used with printf?

There are several format specifiers available in printf. The format specifier used varies depending on the data type used for printing. The given below are some of the format specifiers used with printf in C program. For integer data type the format specifier used with printf is %d or %i For float
 

Assign values during declaration

How to assign values during declaration of variables Declaring variables tells the compiler the data type the variable is assigned and no storage area is allocated during this stage. It is possible to assign values during declaration itself. For example, consider the following program: main() {
 

SQL Programming

SQL Programming Overview Anybody who has done something for a long time has probably wanted to change how things work at some point or another. A worker at a mill might have found a more efficient way of cutting logs, or a mathematics teacher might have had a hand in changing a school’s al
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

WinRunner Programming Concepts

If you want to create WinRunner scripts that are highly efficient, there are important programming concepts that you will want to become familiar with. Understanding these concepts will provide you with a large number of key benefits. In addition to understanding these concepts, you must also learn
 

Choosing The Best Format For Your Resume

Writing a resume can be stressful enough, but when you do a little bit of research you can get even more stressed when you realize that there are several different resume styles that may or may not apply to you.  Yikes!  Luckily, all of these different resume types can be broken do
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape