Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
Location Chicago IL, USA

Exam PCAP topic 1 question 5 discussion

Actual exam question from Python Institute's PCAP
Question #: 5
Topic #: 1
[All PCAP Questions]

A compiler is a program designed to (Select two answers)

  • A. rearrange the source code to make it clearer
  • B. check the source code in order to see of it's correct
  • C. execute the source code
  • D. translate the source code into machine code
Show Suggested Answer Hide Answer

Suggested Answer: BC

Comments

Tommychitarra
Highly Voted 11 months, 1 week ago
IT'S B AND D GUYS. A COMPILER DOES NOT EXECUTE THE SOURCE CODE. C is ABSOLUTELY FALSE (and we exclude A for obvious reasons) then THE ANSWER IS B AND D
upvoted 19 times
Timlead
1 month, 2 weeks ago
Yes, exactly, B and D. I have came across these wrong answers many times. That’s a shame ! How would a compiler execute a code ? It just generate executable and/or library files.
upvoted 1 times
...
...
faltu1985
Highly Voted 1 year, 8 months ago
ans should be c,d
upvoted 5 times
...
smh
Most Recent 5 days, 9 hours ago
Ans is C and D. Please update the answers
upvoted 1 times
...
PythonPuhal
3 months, 1 week ago
B is for interpreters, not compilers
upvoted 1 times
...
Patxidraks92
3 months, 1 week ago
B and D. A compiler do not execute code.
upvoted 1 times
...
F_Eldin
5 months, 1 week ago
The question should say "Interpreter" instead of "compiler". Compilers do not run code. Compiler scans the entire program and translates the whole of it into machine code at once. Interpreter translates one statement of the program at a time into machine code and runs it.
upvoted 2 times
...
KC
6 months ago
https://www.thoughtco.com/what-is-a-compiler-958322
upvoted 1 times
...
Not_Here_No
6 months, 1 week ago
Answer is B and D. A simple google search shows that a compiler acts as an mediator between the human language and machine code. As such, the compiler parses the source code and converts it to machine code. Thus, B and D are the correct answers.
upvoted 1 times
...
Nehuuu
9 months ago
Answer is b and d..
upvoted 1 times
...
Truth
10 months ago
Thank you Tommy! I don't know if the others were just guessing, or feeding off of each other. Even with 25 years of experience with compilers, I was beginning to doubt myself seeing all those references to 'C'. Ouch!
upvoted 2 times
...
rokk_cm
1 year, 5 months ago
maybe b, ca and d https://whatis.techtarget.com/definition/compiler When executing (running), the compiler first parses (or analyzes) all of the language statements syntactically one after the other and then, in one or more successive stages or "passes", builds the output code, making sure that statements that refer to other statements are referred to correctly in the final code. Traditionally, the output of the compilation has been called object code or sometimes an object module . (Note that the term "object" here is not related to object-oriented programming.) The object code is machine code that the processor can execute one instruction at a time.
upvoted 1 times
...
Pygineer
1 year, 6 months ago
I thought b,c,d
upvoted 1 times
...
anjuvinayan
1 year, 6 months ago
Answer is C and D
upvoted 4 times
...
gisswang
1 year, 8 months ago
the source code could not be executed normally, but compiler should check the source code before compile it to machine code.
upvoted 1 times
...

SaveCancel