11.1 Programming basics
58 questions in this subtopic. Open a question to solve it and check the official answer.
Programming basics · 16 marks · official answer ready
(c) Two new modules are defined, which will allow two users to exchange messages. Module Description • takes two parameters: Transmit() ○ a string representing a message (already …
Programming basics · 2 marks · official answer ready
9 This truth table represents a logic circuit. INPUT OUTPUT A B C D Z 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 0 1 0 1 0 1 0 0…
Programming basics · 2 marks · official answer ready
9 This truth table represents a logic circuit. INPUT OUTPUT A B C D Z 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 0 1 0 1 0 1 0 0…
Programming basics · 4 marks · official answer ready
(i) Amend the main program to: • prompt the user to input a whole number between 0 and 100 inclusive • read and validate the input from the user • call LinearSearch() with DataArr…
Programming basics · 4 marks · official answer ready
(i) Amend the main program to: • prompt the user to input a whole number between 0 and 100 inclusive • read and validate the input from the user • call LinearSearch() with DataArr…
Programming basics · 3 marks · official answer ready
10 (a) Explain the importance of feedback in a control system. ....................................................................................................................…
Programming basics · 2 marks · official answer ready
(ii) The following pseudocode statement includes array references: OUTPUT "Student ", Name[Count], " scored ", Mark[Count] State the purpose of the variable Count and give its dat…
Programming basics · 4 marks · official answer ready
(b) Examine the following state-transition diagram. Input-A Output-X Input-B Output-W Input-B START S1 S2 S3 Input-A Input-A Input-B S4 Input-A Output-W Complete the table to show…
Programming basics · 4 marks · official answer ready
(b) A program is written to allow a user to input a sequence of values to be checked using the function FindBaseNumber(). The user will input one value at a time. The variable use…
Programming basics · 1 mark · official answer ready
(ii) Test your program using the number 61 as input. Take a screenshot to show the output. Copy and paste the screenshot into part 1(d)(ii) in the evidence document. [1]
Programming basics · 11 marks · official answer ready
2 (a) An algorithm will: 1. input an integer value 2. jump to step 6 if the value is zero 3. sum and count the positive values 4. sum and count the negative values 5. repeat from …
Programming basics · 7 marks · official answer ready
(b) A procedure GetIDs() will: • prompt and input the number of a club • output the StudentID of all the students who are members of that club • output a count of all students in …
Programming basics · 3 marks · official answer ready
7 (a) Write the Boolean expression that corresponds to the given truth table as a sum-of-products. INPUT OUTPUT A B C D Z 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1…
Programming basics · 1 mark · official answer ready
(a) INPUT x IF x < 0 OR x > 10 THEN OUTPUT "Invalid" ENDIF ........................................................................................................................…
Programming basics · 1 mark · official answer ready
(b) INPUT x IF x = "" THEN OUTPUT "Invalid" ENDIF .................................................................................................................................…
Programming basics · 1 mark · official answer ready
(a) INPUT x IF x < 0 OR x > 10 THEN OUTPUT "Invalid" ENDIF ........................................................................................................................…
Programming basics · 1 mark · official answer ready
(b) INPUT x IF x = "" THEN OUTPUT "Invalid" ENDIF .................................................................................................................................…
Programming basics · 6 marks · official answer ready
(c) A program will: • input 50 unique integer values • output the largest value • output the average of the values excluding the largest value. Draw a program flowchart to represe…
