Back to dashboard

Reading mode

Unit 3: Programming Fundamentals

Correct answer is shown on each question. Use Next to read one by one.

Question 1 of 42 0% read

1. Which testing ensures the program meets user requirements?

A Unit testing
B Integration testing
C System testing
D Acceptance testing

2. Which error is detected during program execution?

A Syntax error
B Logical error
C Runtime error
D Typographical error

3. Which JavaScript method is used to add a new item to the end of an array?

A shift()
B pop()
C push()
D join()

4. Which CSS property is used to make text bold?

A font-style
B text-weight
C font-weight
D bold

5. Which JavaScript feature allows code reuse?

A Variable
B Loop
C Function
D Condition

6. Which JavaScript console method is used for debugging?

A console.write()
B console.debug()
C console.log()
D console.print()

7. What is the main purpose of an algorithm?

A Store data
B Design webpages
C Solve a problem step by step
D Write HTML code

8. Which algorithm searches an element by dividing the list into halves?

A Linear search
B Bubble sort
C Binary search
D Selection sort

9. What is the output of a Boolean expression?

A Number
B String
C True or False
D Character

10. Which loop is used when the number of iterations is known?

A while
B do-while
C for
D foreach

11. Which algorithm is best for large sorted data?

A Linear search
B Binary search
C Bubble sort
D Insertion sort

12. Which CSS property is used to align text?

A align
B text-align
C font-align
D position

13. Which tool in a web browser is most commonly used by developers to find and fix errors in JavaScript code?

A The browser's console
B The history tab
C The settings menu
D The bookmarks bar

14. In JavaScript, which keyword is used to declare a variable that can be changed later?

A let
B const
C var
D variable

15. What is the main purpose of CSS (Cascading Style Sheets)?

A To add interactivity to a website.
B To store data for a website.
C To create the structure of a website.
D To control the visual style and layout of a website.

16. Which JavaScript loop runs at least once?

A for
B while
C do-while
D foreach

17. Which CSS property is used to change the background color of an element?

A color
B bgcolor
C background-color
D background-style

18. In HTML5, which tag is used to define a footer for a document or a section?

A <bottom>
B <footer>
C <end>
D <section>

19. Which debugging technique involves checking output step by step?

A Dry run
B Tracing
C Testing
D Compilation

20. Which JavaScript structure can store key-value pairs?

A Array
B Object
C Function
D Loop

21. Which HTML attribute is used to provide additional information about an element?

A class
B id
C style
D title

22. Which JavaScript construct is used to repeat a block of code a certain number of times?

A if-else statement
B for loop
C function
D switch statement

23. Which JavaScript method is used to find the length of an array?

A size()
B count()
C length
D total()

24. Which data structure stores elements in a sequence?

A Object
B Array
C Function
D Variable

25. Which CSS pseudo-class is used to select and style an element when you move your mouse over it?

A :hover
B :active
C :focus
D :link

26. Which JavaScript function displays a message box?

A prompt()
B confirm()
C alert()
D message()

27. Which HTML element is used for the largest heading?

A <h6>
B <heading>
C <h1>
D <head>

28. Which JavaScript statement is used for decision making?

A switch
B if
C else
D All of these

29. What is a set of step-by-step instructions for a computer to solve a problem called?

A An algorithm
B A variable
C A syntax
D A comment

30. What is an error in the code's grammar or spelling called?

A Runtime error
B Logical error
C Syntax error
D User error

31. Which algorithm gives the best result in minimum steps?

A Efficient algorithm
B Long algorithm
C Simple algorithm
D Manual algorithm

32. Which HTML section contains metadata?

A <body>
B <meta>
C <head>
D <title>

33. In JavaScript, what is used to make decisions and execute different code based on a condition?

A A loop
B A function
C A variable
D An if-else statement

34. What will the `console.log(typeof "Hello")` command show in the JavaScript console?

A number
B boolean
C object
D string

35. Which HTML tag is used to create a hyperlink?

A <link>
B <a>
C <href>
D <url>

36. Which HTML tag is used to create a table row?

A <td>
B <th>
C <tr>
D <table>

37. Which CSS property is used to add rounded corners to an element?

A border-style
B border-radius
C corner-style
D box-shadow

38. Which CSS property is used to add space inside an element?

A margin
B padding
C border
D spacing

39. Which CSS property controls the size of text?

A text-size
B font-weight
C font-size
D text-style

40. Which HTML tag is used to collect user input?

A <form>
B <input>
C <textarea>
D <button>

41. Which JavaScript keyword is used to define a function?

A method
B define
C function
D func

42. Which HTML5 tag is used to define the main content of a document, separate from the header and footer?

A <header>
B <footer>
C <main>
D <article>

You finished reading all questions

Try practice mode to check answers without scoring, or play for a scored attempt.