a) i) Write a function called Division that accepts two arguments namely intA and decB, and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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] 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]
Expert Answer:
Answer rating: 100% (QA)
a i Heres the function Division that accepts two arguments intA and decB and returns the result in t... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Which step in the recruitment process involves attracting potential candidates to the organization? A. Selection B. Induction C. Job analysis D. Sourcing
-
Bus service had a stodgy, old-fashioned image when Bonus began developing a new marketing plan in 2007. Co-owned by Greyhound Lines and Peter Pan Bus Lines, Bolt Bus noticed that traditional...
-
How does a general partnership differ from a limited partnership?
-
Rossman [1994] presents an interesting study of average life expectancy of 40 countries. Table B. 16 gives the data. The study has three responses: LifeExp is the overall average life expectancy....
-
As part of its executive compensation plan, Vertovec Inc. granted 54,000 of its no par common shares to executives, subject to forfeiture if employment is terminated within three years. Vertovec's...
-
Image transcription text Angle (0) Location (r) [m] 0 30 45 60 90 0.001 -2.4E+09 -1.2E+09 2.0E+04 1.2E+09 2.4E+09 0.1 -2.2E+01 -9.8E+00 2.5E+00 1.5E+01 2.7E+01 0.2 -1.0E+00 0.0E+00 1.0E+00 2.0E+00...
-
1 In spite of all the problems that businesses encountered during the pandemic, there were a few positive benefits, including Multiple Choice office expenses went down as less office space was...
-
jelle puts 1200 at the end of every year into Ira that averages 5% interest compounded annually. how much be be in the account when she retires after 35 years of investing
-
Why does 10/3 give 3 and not 3.333333333?
-
Explain the three primary types of international strategy and be able to use the international strategy triangle to determine which international strategy is right for a specific firm.
-
Suppose that i and j are both of type int. What is the value of j after each of the following statements is executed? a. for (i = 0, j = 0; i < 10; i++) j += i; b. for (i = 0, j = 1; i < 10; i++) j...
-
Suppose that a variable a is declared as double a = 3.14159. What does each of the following print? a. System.out.println(a); b. System.out.println(a+1); c. System.out.println(8/(int) a); d....
-
Categorize the major focus areas of social entrepreneurship and the challenges unique to each focus.
-
Unearned Revenue was $600 at the end of February and $750 at the end of March. Service Revenue was $4, 200 for the month of March. How much cash was received from revenue during March?
-
Beginning with a country that has a trade deficit, demonstrate graphically what will happen to a countrys potential output with globalization if that countrys costs of production fall. Explain your...
-
These are the rules that must be followed when writing a program. a. Syntax b. Punctuation c. Key words d. Operators
-
You need to test a condition and then execute one set of statements if the condition is true. If the condition is false, you need to execute a different set of statements. What structure will you use?
-
Rewrite the following If-Then-Else If statement as a Select Case statement. If selection == 1 Then Display "You selected A." Else If selection == 2 Then Display "You selected 2." Else If selection ==...
-
An open drainage canal with a rectangular cross section is $3 \mathrm{~m}$ wide and $1.5 \mathrm{~m}$ deep. If the canal slopes $950 \mathrm{~mm}$ in $1 \mathrm{~km}$ of length, what is the maximum...
-
You must design and specify equipment for transporting $100 %$ acetic acid (density $=1000 \mathrm{~kg} / \mathrm{m}^{3}$, $\mu=1 \mathrm{mPa}$ s), at a rate of $11.3 \mathrm{~m}^{3} / \mathrm{h}$,...
-
The Alaskan pipeline was designed to carry crude oil at a rate of 1.2 million $\mathrm{bbl} / \mathrm{day}(1 \mathrm{bbl}=$ $42 \mathrm{gal})$. If the oil is assumed to be Newtonian, with a viscosity...
Study smarter with the SolutionInn App