Login

Welcome, Guest. Please login or register.

April 19, 2024, 09:52:27 am

Author Topic: Trial Multiple Choice Questions  (Read 1073 times)  Share 

0 Members and 1 Guest are viewing this topic.

rrahulk

  • Adventurer
  • *
  • Posts: 8
  • Respect: +20
Trial Multiple Choice Questions
« on: July 27, 2017, 11:27:47 pm »
0
Hi, can someone please answer the following questions?

1. In programming, it is often necessary to use a flag. What is the purpose of a flag?
a) debug a program
b) show which piece of code was executed
c) indicate whether a program worked correctly
d) ensure that initialisation is performed at the start of a program

2. How is a parse tree created in the translation process?
a) The syntactic analyser arranges the token into a logical hierarchical structure that can be understood by the computer
b) The syntactic analyser identifies and defines the syntax of the metalanguage reading one character at a time and placed them in order
c) The syntactic analyser creates a tree like structure by separating all the tokens into variables and identifiers
d) The syntactic analyser stores the tokens and the data structures into a dictionary which is then translated into a parse tree

3. Tom is creating a program to store average monthly temperatures. Temperatures will contain numeric data that is rounded off to two decimal places. What data structure should he use?
a) array
b) 2D array
c) record
d) array of records

Thanks
HSC 2016
IPT (Accelerated): 92

HSC 2017
AdvEng | Mathematics | SDD | Business Studies | Physics

djpetrin15

  • Trailblazer
  • *
  • Posts: 35
  • I don't know what I'm doing here
  • Respect: +9
Re: Trial Multiple Choice Questions
« Reply #1 on: July 31, 2017, 09:08:38 pm »
+1
Hi, can someone please answer the following questions?

1. In programming, it is often necessary to use a flag. What is the purpose of a flag?
a) debug a program
b) show which piece of code was executed
c) indicate whether a program worked correctly
d) ensure that initialisation is performed at the start of a program

2. How is a parse tree created in the translation process?
a) The syntactic analyser arranges the token into a logical hierarchical structure that can be understood by the computer
b) The syntactic analyser identifies and defines the syntax of the metalanguage reading one character at a time and placed them in order
c) The syntactic analyser creates a tree like structure by separating all the tokens into variables and identifiers
d) The syntactic analyser stores the tokens and the data structures into a dictionary which is then translated into a parse tree

3. Tom is creating a program to store average monthly temperatures. Temperatures will contain numeric data that is rounded off to two decimal places. What data structure should he use?
a) array
b) 2D array
c) record
d) array of records

Thanks

Hey rrahulk,
Happy to give some answers.
Q1 is B. Although C is technically correct, flags are boolean statements used specifically to show that certain code was executed
Q2 is A. The wording is a bit off, but a parse tree is created by ordering the tokens based on the metalnguage in the code as it is understood by the computer.
Q3 is A. As Tom is only storing reals in his data structure, and based on one condition, an array is all that is required.
Have you asked your teacher about these, or checked the answers? If not, you should before you ask on a forum like this. If you don't understand the answers they give, then ask here.
Hope this helps!
2017 English (Advanced) | Chemistry | SDD | Indonesian Continuers | Indonesian Extension
2016 Maths Extension 1 93 | Maths Extension 2 87
Always happy to help (especially maths) and provide moral support where needed. It's what I do!