Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA LANGUAGE Design (pseudocode) and implement (source code) a program (name it BestDeal) to determine the best deal when buying a small box of

IN JAVA LANGUAGE Design (pseudocode) and implement (source code) a program (name it BestDeal) to determine the best deal when buying a small box of apples vs. a large box of apples. The program asks the user to enter the weight and price of each box and then determines which box has a better value. The boxes may have the same value. Document your code and properly label the input prompts and the outputs as shown below. Sample run 1: Small box weight: 5 Pounds Small box price: 10 Dollars Large box weight: 12 Pounds Large box price: 18 Dollars Judgment: The large box is a better deal Sample run 2: Small box weight: 5 Pounds Small box price: 10 Dollars Large box weight: 10 Pounds Large box prices: 20 Dollars Judgment: Both boxes are of the same value Sample run 3: Small box weight: 5 Pounds Small box price: 10 Dollars Large box weight: 10 Pounds Large box price: 28 Dollars Judgment: The smaller box is a better deal IN JAVA LANGUAGE Design (pseudocode) and implement (source code) a program (name it Circles) to determine if a circle is either completely inside, overlapping with, or completely outside another circler. The program asks the user to enter the center point (X1, Y1) and the radius (R1) for the first circle C1, and the center point (X2, Y2) and the radius (R2) for the second circle C2. The program then determines if the second circle C2 is either completely inside, or overlapping with, or completely outside the first circle C1. Hint: use the sum of R1 and R2 and the distance between the centers to solve the problem. Document your code, properly label the input prompts, and organize the outputs as shown in the following sample runs. Sample run 1: Circle 1 center is: (0,0) Circle 1 radius is: 6 Circle 2 center is: (1,1) Circle 2 radius is: 1 Judgment: Circle 2 is completely inside circle 1 Sample run 2: Circle 1 center is: (0,0) Circle 1 radius is: 2 Circle 2 center is: (7,7) Circle 2 radius is: 1 Judgment: Circle 2 is completely outside circle 1 Sample run 3: Circle 1 center is: (0,0) Circle 1 radius is: 3 Circle 2 center is: (2,2) Circle 2 radius is: 3 Judgment: Circle 2 is overlapping with circle 1

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

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago