2. What is the difference between the interface and the implementation in a clas
ID: 658201 • Letter: 2
Question
2. What is the difference between the interface and the implementation in a class?
5. What is an invariant? Give examples.
8. Why should the public interface to a class be as small as possible?
2. What, fundamentally, does an istrearn do?
5. What is a file format?
7. What are the four steps for reading a file?
14. What are the two most common uses of the istream member function
clear()?
3. What are hexadecimal numbers used for in computer science? Why?
4. Name some of the options you may want to implement for formatting integer
output.
6. What is the prefix for decimal? For octal? For hexadecimal?
8. What is a field?
11. Which of the following manipulators does not "stick" : hex, scientific,
setprecision, showbase, setw?
12. What is the difference between character I/0 and binary I/0?
15. What is a file position?
16. What happens if you position a flle position beyond the end of flle?
2. What four kinds of storage do we have for a typical program?
5. What is an address? How are memory addresses manipulated in C++?
8. What is a leak?
11. What is a null pointer? When do we need to use one?
16. What is a cast? When do we need to use one?
Explanation / Answer
Answer 5: Invariant: Invariant is a condition that can be executed during the program execution and relied true.
Example : loop invariant is a condition that should be true always the end and beginning of the program .
Answer : Function of iostream : iostream is a header file in c++ that contains the rules that how the cout function work in the program .i.e # include<iostream> here the # are the directive for preprocessor , and iostream file include the basic standard input and output functions .
Answer : File format is the structure from where information is stored in system in a organized way . file formats can be stored specific types of information i.e. jpeg , tiff for image . a file format is basically a layout where the data can be stored properly.
Answer : Null Pointer: Null pointer is a pointer which has no value . it points the base address of the segment . In a program , if we do not have any address to assigned to a pointer then we simply use the null value.
e.g: #include<iostream>
int main(){
int number = NULL;
printf("Value of Number is ", ++number);
return 0;
}
Answer : In computer , data can be divided into several parts that called record . and further record divided into parts that called fields.each record contain several fields information.
ANSWER 2 : Difference between interface and implementing class
Interface has only definition part not implementation part .
Class has both implementation and definition parts in a program .
Answer: prefix for decimal , octal, and hexadecimal
For octal number we added 0 as a prefix. , for hexadecimal number we added 0x and no prefix added for decimal.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.