100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Introduction to Java Programming Comprehensive Version 10th Edition By Daniel Liang (Solution Manual) $14.49   Add to cart

Exam (elaborations)

Introduction to Java Programming Comprehensive Version 10th Edition By Daniel Liang (Solution Manual)

 6 views  0 purchase
  • Course
  • Introduction to Java Programming Comprehensive Ver
  • Institution
  • Introduction To Java Programming Comprehensive Ver

Introduction to Java Programming Comprehensive Version 10e Daniel Liang (Solution Manual) Introduction to Java Programming Comprehensive Version 10e Daniel Liang (Solution Manual)

Preview 4 out of 66  pages

  • July 15, 2023
  • 66
  • 2022/2023
  • Exam (elaborations)
  • Questions & answers
  • Introduction to Java Programming Comprehensive Ver
  • Introduction to Java Programming Comprehensive Ver
avatar-seller
tutorsection
(Introduction to Java Programming Comprehensive Version 10e Daniel Liang)

(Solution Manual, For Complete File, Download link at the end of this File)


This Solutions Manual Includes all java
programming files, download link for all files is
included at the end of this file, these Extra
exercises file is only for preview. You will get
complete solutions Manul files with download
link after payment.

Extra Exercise for Chapter 1
*1.1 (Simple computation) The formula for computing the discriminant of a quadratic equation

ax 2 + bx + c = 0 is b^2 – 4ac. Write a program that computes the discriminant for the equation

3x^2 + 4x + 5.

*1.2 (Physics: acceleration) Average acceleration is defined as the change of velocity divided by the

time taken to make the change, as shown in the following formula:

v1 − v0
a=
t

Here, v0 is the starting velocity in meters/second, v1 is the ending velocity in meters/second, and t is the

time span in seconds. Assume v0 is 5.6, v1 is 10.5, and t is 0.5, and displays the average acceleration.




Extra Exercise for Chapter 2
*2.1 (Rectangle perimeter, area, and diagonal length) Write a program that prompts the user to enter

the width and height of a rectangle and displays the perimeter, area, and the length of diagonal.

Here is a sample run:

<output>

Enter the width and height of a rectangle: 4.25 7.26 <enter icon>

The perimeter is 23.02
The area is 30.855
The length of the diagonal is 8.412496656760108

<end output>

1

,*2.2 (Physics: one dimensional motion) By one dimension, we mean that the object is moving in a

straight line. There are five variables that put together in several equations for describing this

motion:

Eq1: v1 = v0 + a  t

Eq2: d = averageSpe ed  t , averagespe ed = ( v0 + v1 ) / 2


Eq3: d = v0  t + a  t / 2 (Eq3 is derived from Eq1 and Eq2)
2




v =v + 2  a  d (Eq4 is derived from Eq1 and Eq2)
2 2
Eq4: 1 0


Where

v1 is the final velocity in meters per second ( m / s )

v0 is the initial velocity in meters per second ( m / s )

t is the time elapsed in seconds

a is the object’s acceleration in meters per square second ( m / s 2 )

d is the distance traveled in meters

Suppose a ball is released from the top of a building, you can write a program to find out the height of the

building, given the travel time for the ball to the ground. Note that the acceleration due to gravity is

2
constant 9.8 m / s . Here is a sample run:

<output>

Enter the ball travel time in seconds: 2.5 <enter icon>

The height of the building is 30.625 meters

<end output>

*2.3 (Physics: friction coefficient) The force pushing or pulling an object is related to the object’s mass,

acceleration, and a coefficient of friction in the following formula:

F = umg +ma

Where

F is the force applied to push or pull an object in Newtons (N)

u is a coefficient of friction ( u k is small for a smooth surface and large for a rough surface)

2

, m is the object’s mass in kilograms (kg)

g is the acceleration due to gravity, which is a constant 9.8 m / s 2 (meters per square second)

a is the object’s acceleration in meters per square second ( m / s 2 )

Write a program that prompts the user to enter input for F , m , and a , and displays the coefficient of

friction. Here is a sample run:

<output>

Enter the friction force in Newtons: 150 <enter icon>

Enter the object’s mass in kg: 24.5 <enter icon>

Enter the object’s acceleration in m/s^2: 4.5 <enter icon>

The coefficient for friction is 0.165556

<end output>

*2.4 (Slope of a line) Write a program that prompts the user to enter the coordinates of two points (x1,

y1) and (x2, y2), and displays the slope of the line connects the two points. The formula of the

slope is ( y2 − y1 ) /( x2 − x1 ) . Here is a sample run:

<output>

Enter the coordinates for two points: 4.5 -5.5 6.6 -6.5 <enter icon>

The slope for the line that connects two points (4.5, -5.5) and (6.6, -

6.5) is -0.47619

<end output>




Extra Exercise for Chapter 3
*3.1 (Reduce fractions) Write a program that prompts the user to enter the numerator and denominator

of a fraction. The program determines whether the number is a proper fraction or an improper

fraction. If it is a proper fraction, display the number. If not, reduce it to a mixed fraction or to an

integer. Here are sample runs:

<output>

Enter a numerator: 45 <enter icon>
Enter a denominator: 46 <enter icon>
3

, is a proper fraction

<end output>

<output>

Enter a numerator: 45 <enter icon>
Enter a denominator: 25 <enter icon>
is an improper fraction and it can be reduced to 3

<end output>

<output>

Enter a numerator: 45 <enter icon>
Enter a denominator: 15 <enter icon>
is an improper fraction and it can be reduced to 3

<end output>

<output>

Enter a numerator: 45 <enter icon>
Enter a denominator: 25 <enter icon>
is an improper fraction and its mixed fraction is 1 + <enter

icon>

<output>



*3.2 (Slope-intercept form) Write a program that prompts the user to enter the coordinates of two points

(x1, y1) and (x2, y2), and displays the line equation in the slope-intercept form, i.e., y = mx + b.

For a review of line equations, see http://www.purplemath.com/modules/strtlneq.htm. m and b can

be computed using the following formula:

m = ( y2 − y1 ) /( x2 − x1 ) b = y1 − mx1

Don’t display m if it is 1 and don’t display b if it is 0. Here are sample runs:

<output>

Enter the coordinates for two points: 1 1 0 0 <enter icon>

The line equation for two points (1, 1) and (0, 0) is y = x

<end output>

<output>

Enter the coordinates for two points: 4.5 -5.5 6.6 -6.5 <enter icon>

The line equation for two points (4.5, -5.5) and (6.6, -6.5) is
4

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller tutorsection. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $14.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

79316 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$14.49
  • (0)
  Add to cart