Question 4: A developer is confused about the difference between integer, floating-point, character, and string literals in C++. They also want to know how to represent numbers in octal and hexadecimal formats. How would you explain different types of literals in C++? Provide examples for each type, including octal (0 prefix) and hexadecimal (0x prefix) literals. [10]
Question 5: You are developing a billing system that calculates the total cost of a product, given its price (float) and quantity (integer). However, your program is giving unexpected results because of mixed data types. What is implicit and explicit type conversion in C++? How can you ensure the correct calculation of total cost in your program? Provide a C++ code snippet demonstrating type casting for accurate results. [10]