Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) Specify all the data types (including classes) used in the program, giving one of the values used for each type. b) List all the

image text in transcribed

a) Specify all the data types (including classes) used in the program, giving one of the values used for each type.

b) List all the loop constructs used in the program and give the keywords and syntax required in each case. Where there is the possibility to use an alternative construct, say what this is.

c) Describe the sequence of operations when calling getSpend with P3 as the parameter. What will the returned value be?

d)Describe the sequence of operations when calling getSpend with P1 as the parameter. What will the returned value be?

e)How will an instance of this class appear when printed out, i.e, when supplied as an actual parameter in a call to System.out.println()?

1. Consider the following Java program, which consists of the class Spends. Notice this defines getSpend, isAmount and toString methods. Remember that Integer.parseInt applied to a String representation of an integer returns the integer in question public class Spends I d private String [ ] {"P1", "10", "15", "P2", "12", = public int getSpend (String id) i int spend0; boolean done = false; for (int i-0; i

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_2

Step: 3

blur-text-image_3

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

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

How do cultures and social communities shape communication?

Answered: 1 week ago

Question

2. How were various roles filled?

Answered: 1 week ago