Basic Java Programming Math Functions Write a Java program that allow the user to input for...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Basic Java Programming Math Functions Write a Java program that allow the user to input for the two angles A, and B (all in degrees), and the side a of an oblique triangle. Thereafter, solve for the triangle using laws of sine. Draw the user interface. Note: The sum of the interior angle of a triangle is always equal to 180. TEST CASE #1 TEST CASE #2 sin A + + sin B sine C Enter Angle A: 60 Enter Angle B:100 Enter Side a: 40 Angle C: 20.0 Enter Angle A: 50 Enter Angle B: 80 Enter Side a: 100 Angle C: 50.0 Side b: 128.5575 Side c: 100.0000 String Write a Java program to find a certain character in a string and replace it with a new character. Allow user to enter a string, find character and the replace character. Display the new string. TEST CASE #1 Enter a string: AABBCCDDD Find a character: A Replace with: S New String: SSBBCCDDD Array Write a Java program to find frequency of each character in a given string. Also display the length and the most frequent among the characters TEST CASE #1 Enter a string: AAABBBBCCCCC A=3 B=4 C=5 Length 12 Most Frequent = C Basic Java Programming Math Functions Write a Java program that allow the user to input for the two angles A, and B (all in degrees), and the side a of an oblique triangle. Thereafter, solve for the triangle using laws of sine. Draw the user interface. Note: The sum of the interior angle of a triangle is always equal to 180. TEST CASE #1 TEST CASE #2 sin A + + sin B sine C Enter Angle A: 60 Enter Angle B:100 Enter Side a: 40 Angle C: 20.0 Enter Angle A: 50 Enter Angle B: 80 Enter Side a: 100 Angle C: 50.0 Side b: 128.5575 Side c: 100.0000 String Write a Java program to find a certain character in a string and replace it with a new character. Allow user to enter a string, find character and the replace character. Display the new string. TEST CASE #1 Enter a string: AABBCCDDD Find a character: A Replace with: S New String: SSBBCCDDD Array Write a Java program to find frequency of each character in a given string. Also display the length and the most frequent among the characters TEST CASE #1 Enter a string: AAABBBBCCCCC A=3 B=4 C=5 Length 12 Most Frequent = C
Expert Answer:
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these algorithms questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Briefly describe ASCII and Unicode and draw attention to any relationship between them. [3 marks] (b) Briefly explain what a Reader is in the context of reading characters from data. [3 marks] A...
-
Calculate the Total Cost of Ownership of the following 2 models and determine which model is a better buy. Model X Model Y $50,000 $60,000 Purchase price = Expected useful life = Maintenance cost per...
-
How might a purchasing manager use his or her position to defraud the company? What can be done to prevent it? Where could an auditor look to find evidence of losses on purchase commitments and...
-
Liquid extraction is an operation used to separate the components of a liquid mixture of two or more species. In the simplest case, the mixture contains two components: a solute (A) and a Liquid...
-
Ram Lal Sewa Samiti Ltd. purchased 30000 shares of Sippy and Sons Ltd. at a cost of Rs. 312 per share in the month of December 2005. It again purchased 30000 shares of the same company at a cost of...
-
For each of the following situations, identify the correct factor to use from Table on future value and present value tables. Also, compute the appropriate present value. 1. Annual net cash inflows...
-
Level 2 - Calculating Travel Costs at America Travels As a new sales associate at America Travels travel agency, you assist travel agents in finding the best fares for corporate customers. As a...
-
A GIFT TO RETIREES THE ROTH IRA CELEBRATES its 20th birthday this year, and like a lot of 20-year-olds, it has never looked so good. You cant take a tax deduction for Roth contributions, but the...
-
Organizations in the construction industry monitor interest and unemployment rates. Any dramatic increases in these rates will negatively impact their industry. This is an example of what element of...
-
Q-1: Differentiate between unconsolidated undrained test and a drained test. Explain under which conditions you will recommend these tests for design purposes. Give examples. [CLO1:C2:PLO1] (5) Q-2:...
-
1.) Graphically show how an increase in the population affects price and quantity. How would a decrease impact price and quantity? 2.) What would have happened in this case if the shop owner had...
-
After many years of amateur status, rugby union became a professional sport in 1995. Pick one of the four major North American team sports (baseball, basketball, football, or ice hockey), and imagine...
-
While in a geosynchronous orbit around Earth, a 560-kg communications satellite has a weight of 125 N. The distance of the satellite from the surface of Earth, expressed in scientific notation, is b...
-
1) L(21 1) dt 2) S 3) x(x + 1)dx -1 xdx 5) Jo Ji+ 2x
-
What are the typical record-at-a-time operations for accessing a file? Which of these depend on the current file record?
-
Write a program that enables the user to specify the location and size of the rectangles and displays whether the two rectangles intersect, as shown in Figure 16.39b. Enable the user to point the...
-
An H-tree (introduced at the beginning of this chapter in Figure 18.1) is a fractal defined as follows: 1. Begin with a letter H. The three lines of the H are of the same length, as shown in Figure...
-
Revise Programming Exercise 2.8 to display the hour using a 12-hour clock. Here is a sample run: Listing 2.7, ShowCurrentTime.java, gives a program that displays the current time in GMT. Revise the...
-
For several years, the Otis Capital USA Corp has been exploring for gold on its mining claims held on public lands near the Idaho-Montana border. Otis filed a proposal to expand its current...
-
Beginning around 1915, Natural Products Refining Corporation (NPRC) operated a chemical plant in Jersey City, New Jersey, at which it turned chromite ore into chromium chemicals (primarily sodium...
-
In January 2011, Sprint entered into a contract with Cellustar under which Cellustar agreed to become a distributor of Sprints prepaid mobile phone service and product brand, Boost Mobile, in Puerto...
Study smarter with the SolutionInn App