ICT Q2 EXAM

Cards (116)

  • What are variables used for in C++?
    To store data for later use
  • What are the main data types in C++?
    • String (sentences)
    • Char (one letter)
    • Bool (true or false)
    • Int (positive & negative numbers)
    • Float (less precise decimal)
    • Double (more precise decimal)
  • What does the char data type represent in C++?
    It represents a single letter
  • What does the bool data type indicate in C++?
    It indicates true or false values
  • What is an example of an int variable in C++?
    numberOne = 100
  • How does the float data type differ from the double data type in C++?
    Float is less precise than double
  • How would you print "B1 is a programmer" in C++?
    Cout << "B1 is a programmer" << endl;
  • What is the output of the following C++ code?
    Cout << nameOne << " is a" << occupation << endl;
    • Outputs: "B1 is a programmer"
  • What does the endl command do in C++?
    It ends the current line and moves to the next line
  • What is the purpose of the variable occupation in the provided C++ code?
    To store the string "programmers"
  • How would you declare two string variables in C++?
    • String nameOne = "B1";
    • String nameTwo = "B2";
  • What is the output of the following C++ code?
    Cout << nameOne << " and" << nameTwo << " are partners" << endl;
    It outputs: "B1 and B2 are partners"
  • Who prepared the pseudocode document?
    JOHN MICHAEL E. LANDAS
  • What is pseudocode?
    A method that allows a programmer to represent the algorithm in a programming-related way
  • Why is pseudocode also called false codes?
    Because it tends to look like a programming language but can still be understood by non-programmers
  • What are the do's and don'ts of writing pseudocode?
    Do's:
    • Proper naming convention
    • Simple and concise

    Don'ts:
    • Don't make it abstract
    • Don't make it generalized
  • What is the pseudocode for a program that displays the sum of two numbers?
    Let numOne = 0, numTwo = 0 and sum = 0; Input numOne and numTwo; sum = numOne + numTwo; Output sum
  • What is the pseudocode for a program that displays the average of two numbers?
    Let numOne = 0, numTwo = 0, sum = 0 and ave = 0; Input numOne and numTwo; sum = numOne + numTwo; ave = sum/2; Output ave
  • What is an alternative pseudocode for calculating the average of two numbers?
    Let numOne = 0, numTwo = 0 and ave = 0; Input numOne and numTwo; ave = (numOne + numTwo)/2; Output ave
  • What is the programming problem for displaying "Even" or "Odd"?
    Create a program that will display "Even" or "Odd" depending on the number inputted by the user
  • Who prepared the flow chart?
    John Michael E. Landas
  • What is the purpose of pseudocode in programming?
    • To represent algorithms in a programming-related way
    • To be understandable by individuals with little programming knowledge
    • To serve as a bridge between human language and programming languages
  • What is a flow chart?
    A method that allows a programmer to represent an algorithm in a diagram or illustration
  • What is the best website for creating flow charts?
    draw.io
  • What does a flow chart represent in programming?
    It represents the sequence of a programming algorithm using standard graphic symbols
  • What is the pseudocode for a program that displays the sum of two numbers?
    1. Let numOne = 0, numTwo = 0, and sum = 0
    2. Input numOne and numTwo
    3. sum = numOne + numTwo
    4. Output sum
  • What is the pseudocode for a program that determines if a number is even or odd?
    1. Let num = 0
    2. Input num
    3. If num is an even number, Output "Even"
    4. If num is an odd number, Output "Odd"
  • Who prepared the content on common types of program algorithms?
    John Michael E. Landas
  • What does the learner demonstrate in the content standards?
    Understanding of algorithms and programming
  • What is the performance standard for learners regarding algorithms and programming?
    Independently demonstrate knowledge and skills in developing a computer program
  • What are the objectives of the study material?
    • Discuss Sequential and Conditional selection
    • Write codes using variables
  • What questions were posed regarding the relevance of program algorithms?
    Why study program algorithm? Can we apply it in our daily living?
  • What are the common types of program algorithms mentioned?
    • Sequential
    • Conditional
    • Looping/Repetition
    • Modulo
  • What is a sequential algorithm?
    An algorithm that runs from top-down without interruption until it finishes
  • What is a problem example for a sequential algorithm?
    Create a pseudocode and flowchart for computing an employee's salary
  • What is the pseudocode for computing an employee's salary?
    • Let rate = 0; hours = 0; salary = 0;
    • INPUT rate, hours
    • Salary = rate * hours
    • OUTPUT salary
  • What is the formula to compute salary in the pseudocode?
    Salary = rate * hours
  • What is a problem example for a conditional algorithm?
    Create a pseudocode and flowchart for computing an employee's salary with conditions
  • What does a conditional algorithm do?
    Affects the output based on a certain condition
  • What is the pseudocode for the conditional salary computation?
    • Let salary = 0; rate = 0; hours = 0;
    • INPUT rate, hours
    • Salary = rate * hours
    • IF salary > 10000 THEN
    • OUTPUT "High Pay"
    • ELSE
    • OUTPUT "Low Pay"
    • ENDIF