✦ VidyaVerseOpen interactive version

← Programming Concepts in Mechanical Engineering (25ME34I)

Viva-Voce Questions with Short Answers

Programming Concepts in Mechanical Engineering (25ME34I) · C-25 Diploma Mechanical, Semester III

Read with diagrams, search and self-test

1. What is an algorithm? A finite, ordered set of unambiguous steps that solves a problem.

2. Name the flowchart symbol for decision. Diamond.

3. Who created Python and when? Guido van Rossum, 1991.

4. Is Python compiled or interpreted? Interpreted (source is compiled to byte code and run by the PVM).

5. What is dynamic typing? The type of a variable is decided at run time from its value.

6. What does input() return? Always a string.

7. Difference between / and //? / gives a float quotient; // gives the floor quotient.

8. What is indentation used for? To define blocks of code.

9. What is the use of elif? To test several conditions in sequence.

10. When is a while loop preferred? When the number of iterations is not known in advance.

11. Difference between break and continue? break exits the loop; continue skips to the next iteration.

12. What is a function? A named, reusable block of code that performs a task.

13. What is the difference between a parameter and an argument? A parameter is in the definition; an argument is the value passed in the call.

14. What is a lambda function? An anonymous one-expression function.

15. What is a module? A .py file of functions/variables that can be imported.

16. List vs tuple? A list is mutable; a tuple is immutable.

17. How is a dictionary value accessed? By its key, d[key] or d.get(key).

18. Why use the with statement for files? It closes the file automatically.

19. What is a CSV file? A text file with comma-separated values, readable by Excel.

20. What is an exception? A run-time error that disrupts normal execution.

21. What does finally do? Runs cleanup code whether or not an exception occurred.

22. What is a class? What is an object? A class is a blueprint; an object is an instance of it.

23. What is self? Reference to the current object.

24. What is inheritance? A child class acquiring the features of a parent class.

25. What is polymorphism? One interface (method name/operator) with different behaviours.

26. What is encapsulation? Bundling data and methods and restricting direct access.

27. What is GPIO? General Purpose Input/Output pins of the Raspberry Pi.

28. What voltage do Raspberry Pi GPIO pins use? 3.3 V.

29. Why is a motor driver needed? The Pi cannot supply the motor's current/voltage and must be protected.

30. What is PWM? Switching a signal on and off rapidly with variable duty cycle to vary average voltage.

31. What is an H-bridge? A four-switch circuit that reverses motor direction.

32. Which sensor measures humidity? DHT11/DHT22.

33. What protocol does BMP180 use? I²C.

34. How does HC-SR04 calculate distance? From the echo time: d = t × 17150 cm.

35. What is SQC? Use of statistical methods to control quality.

36. What are chance and assignable causes? Natural random causes versus identifiable special causes.

37. What is plotted on an X-bar chart and R chart? Sample means and sample ranges.

38. Formula of UCL for X-bar chart? X̿(cid:13) + A₂Rm .

39. Define Cp and Cpk. Cp = (USL − LSL)/6σ; Cpk = min[(USL − μ), (μ − LSL)]/3σ.

40. What is the minimum acceptable Cpk? 1.33 (commonly).

41. What is a p-chart? A control chart for fraction defective.

42. What is a c-chart? A control chart for number of defects per unit.

43. What is a null hypothesis? A statement of no difference or no effect.

44. When is ANOVA used? To compare three or more means.

45. What is DOE? Planned experiments to find the effect of factors on a response.

46. What is the Pareto principle? 80 % of problems come from 20 % of causes.

47. What are the 6M of the fishbone diagram? Man, Machine, Method, Material, Measurement, Mother nature.

48. What does Six Sigma aim at? 3.4 defects per million opportunities.

49. What is FEM? A numerical method that divides a body into elements to find approximate solutions.

50. Write the stiffness matrix of a bar element. (AE/L)[[1, −1], [−1, 1]].