Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 4, Problem 4.3PE

(Geography: estimate areas) Use the GPS locations for Atlanta, Georgia; Orlando, Florida; Savannah, Georgia; and Charlotte, North Carolina in the figure in Section 4.1 to compute the estimated area enclosed by these four cities. (Hint: Use the formula in Programming Exercise 4.2 to compute the distance between two cities. Divide the polygon into two triangles and use the formula in Programming Exercise 2.19 to compute the area of a triangle.)

Blurred answer
Students have asked these similar questions
Leap Year: The earth doesn't take exactly 365 days to revolve around the sun and because of this we have leap years roughly every 4 years to make up the difference. The exact rule is: • Years divisible by 4 are leap years • except if they are also divisible by 100 and then they are not leap years (so 1900 was not a leap year), • unless they are also divisible by 400 and then they ARE leap years (so 2000 was a leap year). Part 1) Write a function in Python that takes as input a number, the year, and determines if it is a leap year or not. The function should return True if it is a leap year and False otherwise. Part 2) Write a main function to test out your leap year function on a few different illustrative inputs.
1) Simple Calculator: In Python, implement a simple calculator that does the following operations: summation, subtraction, multiplication, division, sqrt, power, natural log and abs. a) Follow the instructions below: To work with the calculator, the user is asked to enter the first number, then the operation, and finally, a second number if required. Your code has to recognize the need for the second number and ask for it if required. After performing one operation, the calculator prints the output of the operation. After performing one operation, the calculator must not exit. It has to start again for the next operation. The calculator will be closed if the user writes 'e' as any input. Use functions to perform the operations and the appropriate conditions to prevent common errors such as entering characters as one of the numbers etc. b) Run your code and provide the results for at least one example per operation. - -
How to attempt? Question : The Card Game One day, Fred and his N friends were playing a card game in which each player throws a card with a number written on it. The cards are such that a number X is written on front of the card, and the negative of that number is written on the back side of the card. This game has the following rules: - Each of the N players is asked to throw a card. After all the N cards are thrown, Fred has to flip one or more cards in consecutive order, only once. Your task is to help Fred flip the cards in such a way that the sum of the numbers, on front face of the cards, is the maximum.

Chapter 4 Solutions

Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)

Ch. 4.3 - Evaluate the following: Int i = '1'; int j ='1' +...Ch. 4.3 - Can the following conversions involving casting be...Ch. 4.3 - Show the output of the following program: public...Ch. 4.3 - Write the code that generates a random lowercase...Ch. 4.3 - Show the output of the following statements:...Ch. 4.4 - Suppose s1, s2, and s3 are three strings, given as...Ch. 4.4 - Prob. 4.4.2CPCh. 4.4 - Show the output of the following statements (write...Ch. 4.4 - Prob. 4.4.4CPCh. 4.4 - Let s1 be " Welcome " and s2 be " welcome ". Write...Ch. 4.4 - Write one statement to return the number of digits...Ch. 4.4 - Write one statement to return the number of digits...Ch. 4.5 - If you run Listing 4.3 GuessBirthday.java with...Ch. 4.5 - If you enter a lowercase letter such as b, the...Ch. 4.5 - What would be wrong if lines 6 and 7 are in...Ch. 4.6 - Prob. 4.6.1CPCh. 4.6 - Prob. 4.6.2CPCh. 4.6 - Show the output of the following statements: (a)...Ch. 4 - (Geometry: area of a pentagon) Write a program...Ch. 4 - (Geometry: great circle distance) The great circle...Ch. 4 - (Geography: estimate areas) Use the GPS locations...Ch. 4 - (Geometry: area of a hexagon) The area of a...Ch. 4 - (Geometry: area of a regular polygon) A regular...Ch. 4 - (Random points on a circle) Write a program that...Ch. 4 - (Corner point coordinates) Suppose a pentagon is...Ch. 4 - (Find the character of an ASCII code) Write a...Ch. 4 - (Find the Unicode of a character) Write a program...Ch. 4 - (Guess birthday) Rewrite Listing 4.3,...Ch. 4 - (Decimal to hex) Write a program that prompts the...Ch. 4 - (Hex to binary) Write a program that prompts the...Ch. 4 - (Vowel or consonant?) Write a program that prompts...Ch. 4 - (Convert Letter grade to number) Write a program...Ch. 4 - (Phone key pads) The international standard...Ch. 4 - (Random character) Write a program that displays a...Ch. 4 - (Days of a month) Write a program that prompts the...Ch. 4 - (Student major and status) Write a program that...Ch. 4 - (Business: check ISBN-10) Rewrite Programming...Ch. 4 - (Process a string) Write a program that prompts...Ch. 4 - (Check SSN) Write a program that prompts the user...Ch. 4 - (Check substring) Write a program that prompts the...Ch. 4 - 23 (Financial application: payroll) Write a...Ch. 4 - (Order three cities) Write a program that prompts...Ch. 4 - (Generate vehicle plate numbers) Assume that a...Ch. 4 - (Financial application: monetary units) Rewrite...
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Literals in Java Programming; Author: Sudhakar Atchala;https://www.youtube.com/watch?v=PuEU4S4B7JQ;License: Standard YouTube License, CC-BY
Type of literals in Python | Python Tutorial -6; Author: Lovejot Bhardwaj;https://www.youtube.com/watch?v=bwer3E9hj8Q;License: Standard Youtube License