Question: a) i) Write a function called Division that accepts two arguments namely intA and decB, and the function returns a result in Decimal data
a) i) Write a function called Division that accepts two arguments namely intA and decB, and the function returns a result in Decimal data type. intA is divided by decB and the result is stored to Division. (4 marks) ii) b) i) Declare a one-dimensional array called intNumbers and initialise it with the values of 10, 20, 30, 40 and 50. (2 marks) ii) Use a For loop to calculate the sum value of all the elements from intNumbers. (5 marks) c) i) Do you think there is a need to use a Try-Catch Block for your answer in Question 3 a) i)? Provide TWO (2) justifications to support your opinion. (6 marks) ii) Create a private structure called Car. The structure consists of three elements, which includes manufacturer, number and year. (4 marks) Create a variable of a car that is based on the structure that you had defined in Question 3 c) i). The variable is called Preve. Assign the variable with Proton as the value for manufacturer element, WWW8888 as the value for the car plate number element and year of 2008. (4 marks) [Total: 25 marks]
Step by Step Solution
3.44 Rating (144 Votes )
There are 3 Steps involved in it
a i Heres the function Division that accepts two arguments intA and decB and returns the result in t... View full answer
Get step-by-step solutions from verified subject matter experts
