Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java programming question (Object oriented programming) Answer FULL question properly for thumbs up: Question 2 (a) A programmer decides to use Java instead of C

Java programming question (Object oriented programming)

Answer FULL question properly for thumbs up:

image text in transcribed

Question 2 (a) A programmer decides to use Java instead of C in a project, partly because "errors are handled better and debugging is easier". With reference to the features and the programming environments of both languages, explain why the programmer might have arrived at this conclusion. (b) The programmer in (a) notes that her main reason for choosing Java over C has to do with "the cleaner structure and improved reusability of the code, and the way it better models the problem domain" Explain carefully what she means by this statement. (c) The questions that follow concern this statement from a Java program: List data-new ArrayList> (i) The author of this code has made a typing error that will prevent it from compiling. Why does the problem occur? What change is needed to fix it? () The statement refers to a List on the left hand side of the assignment, rather than an ArrayList. Why is this not a problem? What, in general, is the benefit (ii) What are the circumstances under which ArrayList is an appropriate choice of (d) A computer science student is given the task of writing Java software to tally votes in of lesing thiis? implementation for this particular list? a Student Union election. He decides to represent candidate names as a list of strings and the corresponding total votes for each candidate as a list of integers. Explain the drawbacks of this approach. Propose a better Java data structure for the task, explaining clearly why it is superior. Give an example of the code needed to create an instance of this data structure

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

ISBN: 133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago