How can I find the area of triangle without using all three sides. You can only use 2 side and angle between them in java
Q: Write an application that prints the following diamond shape. You may use outputstatements that…
A: Given: Write an application that prints the following diamond shape. You may use outputstatements…
Q: In Java Sound power level is expressed in decibels. A decibel is 10 x log10(picoWatts), where a…
A: Introduction Scanner Class in Java: A class called Scanner may be found in java.util package and is…
Q: Write an application that prints your initials in large block letters. Make each large letter out of…
A: STEP BY STEP COMPLETE PROGRAM INCLUDED WITH COMMENTS AND SCREENSHOT OF OUTPUT :
Q: In Java: The program extends the representation for rational numbers Add a test class…
A: Algorithm: Start Create a class named Rational with numerator and denominator as its attributes…
Q: Click the four endpoints of the rectangles given in the java statements. 1. g.drawRect(600, 0, 200,…
A: drawRect(int x,int y,int width,int height) it is used to create rectangle in applet or in gui
Q: How to do it in the JAVA language? Write a program that has the following "static" return value…
A: We have to write a Java program Which has static" return value methods. The parameters have…
Q: Find the Other Two Side Lengths in Java Given the shortest side of a 30° by 60° by 90° triangle,…
A: The following steps need to be taken for the given program:Define a Java method `otherSides` that…
Q: Write this in Java: (Geography: estimate areas) Use the GPS locations for Atlanta, Georgia; Orlando,…
A: Write this in Java: (Geography: estimate areas) Use the GPS locations for Atlanta, Georgia;Orlando,…
Q: Rewrite Exercise 3.5 using the following function to return the area of a regular polygon:def…
A: // C++ Program to find the area of a regular// polygon with given side length #include…
Q: java(D isplaying Square of Asterisks)can you please help me to Write method squareOfAsterisks to…
A: HerrI have created a function named squareOfAsterisks(). In this function I have taken 2 nested loop…
Q: If you add up all the digits in 468, you get 4 + 6 + 8 = 18. The square and cube of 468 are 219024…
A: As the language is not mentioned, So here is the python program for the same.
Q: You are given two int variables j and k, an int array zipcodeList that has been declared and…
A: Java is a multi-platform, object-oriented, and network-centric language that can be used as a…
Q: public class TrafficLightViewer 2 { 1 3. public static void main(String[] args) 4 Rectangle rl = new…
A: TrafficLight.java: import java.awt.BasicStroke;import java.awt.Color;import…
Q: Use Python & Don't use any python Library. You can use Random.randint() only. 3. Suppose you have…
A: import random #taking sample list of participants l=["ada","bark","cowl","dam","jack","nick","sam"]…
Q: You are building a diving board by placing a bunch of planks of wood end-to-end. There are two types…
A: Using python we write the following program with self explanatory embedded comments to generate the…
Q: HELP IN JAVA CODE PLEASE Create code using DrawingPanel to generate values for a magic square based…
A: Lets see the solution.
Q: of her graduation photo. The ladder is placed at 2 feet away from the wall. The angle that is formed…
A: Let consider the given data and construct a triangle as shown below:
Q: You have a card on which the letter J is written on one side and K on the other. You want to see all…
A: The program illustrate a recursive function in java with a simple card problem as given in the…
Q: How do I code: If the difference is positive, return “a is bigger by” + diff. If the difference is…
A: Given: We have to write a java code to compare two numbers and print different values in different…
Q: Given a list of integers, you want to know whether it is possible to divide the integers into two…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Implement a method…
Q: Write a Java program using at least one for loop that prints pictures of piles of counters of…
A: Given: Write a Java program using at least one for loop that prints pictures of piles of counters of…
Q: Write a Java program that reads from the user the 3 points forming a triangle and calculates the…
A: Algorithm: 1. Start 2. Initialize variables for three points a, b, and c. 3. Read the coordinates…
Q: Write a Java program that asks the user to enter a string and counts how many times the letter "s"…
A: The objective of the question is to write a Java program that performs several operations on a…
Q: java
A: //This is a sample program to calulate the LU decomposition of the given matrix import…
Q: card graphics, create a card game in which the dealer shuffles the deck and deals 13 cards to the…
A: Algorithm : The algorithm for the above code is as follows:1. Start2. Create a deck of cards.3.…
Q: write java statement to shift the content of each cell of an integer array one place to the right,…
A: class RotateRight { public static void main(String[] args) { //Initialize array…
Q: My question is related to java Using java a class called Bag is to be created. This bag is special,…
A: Objective: This program generates three random lowercase characters (a-z) to be stored in a class…
Q: For all of the following words, if you move the first letter to the end of the word, and then spell…
A: Step 1: Prompt and accept a word from the user. Step 2: Check whether it equals quit. If true, then…
Q: Examine the efficacy of TWO (2) additional identified methodologies for assessing hospital care…
A: The Hospitals Readmissions Reduction Program (HRRP) attempts to minimize the cost of health care by…
Q: Explain the results when you XOR something with itself. For example, A XOR A.
A: XOR GATE: XOR gate is basically a logical gate which gives the output as TRUE only when the number…
Q: WRITE IN JAVA USING JOptionPane.showInputDialog Write a program that reads a sentence as input and…
A: Here's the Java program using JOptionPane.showInputDialog to take input from the user:
Q: The rectangular board is given. The coordinates of the left upper corner is (x, y) = (1, 1). The…
A: To solve this problem in Java, we can use dynamic programming. We will create a two-dimensional…
Q: Solve in java Double variable numInches is read from input. Type cast numInches to an integer. Ex:…
A: The objective of the question is to read a double value from the input, and then type cast it to an…
Q: Hi I am coding for java where I have to have 20 fibonacci numbers printed out 5 in a row. Then I…
A: In the given code, the statement “if(count==5)” is never gets “true” because , after printing each…
Q: HIS NEEDS TO BE DONE IN C#!! The Tourtise and The Hair In this lab, we will be simulating the…
A: Note : You may get warning since name is assigned and never used. although program will execute…
Q: (YOU ARE NOT ALLOWED TO USE ARRAYLIST IN THIS PROJECT)Write a Java program to simulate a blackjack…
A: The JAVA code is given below with output screenshot
Q: The following problem shows up in a number of Java texts, including Savitch's textbook: The…
A: The below program prompts the user to enter weight, height, age and sex, then calculates the basal…
Q: Given an array of objects (each object has a height and width), and sheet dimensions (also height…
A: A: Given an array of objects (each object has a height and width), and sheet dimensions (also height…
Q: Write a Java program Primes that finds all possible prime numbers in the range of (1, n], where 1 <…
A: Answer: Below is the code:
Q: JAVA SWING I have definied a straight TUBE as: int rectWidth = 25; // replace 50 with the desired…
A: To define an L tube, you can modify the code to create two rectangles, one for the horizontal part…
Q: Using the code in the image provided: Implement a method called summation which adds two integers…
A: The required answer is in subsequent steps.
Step by step
Solved in 3 steps with 1 images
- Java Programming: Write a program that reads five integer values from the user, then analyzes them as if they were a hand of cards. When your program runs it might look like this (user input is in orange for clarity): Enter five numeric cards, no face cards. Use 2 - 9. Card 1: 8 Card 2: 7 Card 3: 8 Card 4: 2 Card 5: 9 Pair! (This is a pair, since there are two eights). You are only required to find the hands Pair and Straight.I am running a hotdog eating contest parameters are; 10 hotdogs to the pack 8 buns to the pack random # of contestants and hotdogs to be eaten. if say 2 contestants eat 3 hotdogs each how many hotdogs and buns will be left over, how many dogs and bun open packs will there be. This must be written up in java code but my algebra is not working.Java Write a program that calculates the area of a trapezoid after prompting the user for the height, the smaller base, and the larger base.
- Is there a way to create a java program on Branching and selecting method on problems like this? Suppose that we are working for an online service that provides a bulletin board for its users. We would like to give our users the option of filtering out profanity. Suppose that we consider the words cat dog and rabbit to be profane. Write a program that reads a string from the keyboard and test whether the string contain any one of these words. Your program should find words like cAt that differ only in case. Have your program reject only lines that contain one or more of the three words exactly. For example, concatenation is a small category should not be considered profane. This problem can be solved easily. If you add a space to the beginning of the string and a space at the end of the string you only need to check if space cat space or space dog space or space rabbit space is in the string. Use three if statements; one for each word. If one or more of the words are there set…Write in Java and use JOptionPane.showInputDialog Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. When the program begins, a random number is ranged of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper, If the number is 3, then the computer has chosen scissors. (Don’t display the computer’s choice yet.) The user enters his or her choice of “rock”, “paper”, or “scissors” at the key-board. (You can use a menu if you prefer.) The computer’s choice is displayed. A winner is selected according to the following rules: If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors cuts paper.) If one player chooses paper and the other player chooses rock, then paper wins.…Needs to be written in java and completed using "for loops" or "nested for loops" and in one program just seperate methods: Write a program that calls these three methods. method 1 should print: 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 method 2 should print: 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 method 3 should create and array and store 10 multiples of 5 and print it out. Use for loop to generate the multiples and then print them out using a second for loop.
- Write a code that generates a random lowercase letter. In java programming. Note: Not a string of letters just one letter is generated every time the program is run. meaning the output should not be something like this: a c t c -that's a random string, it should only be one random letter generated randomly.In Java (Use the isPrime Method) PrimeNumberMethod.java, provides the isPrime(int number) method for testing whether the number is prime. Use this method to find the number of prime numbers less than 10000. Below are some clarifications for the Java program (a) The lab is to COUNT the prime numbers less than 10000. Do NOT list the prime numbers. (b) A pair prime is two prime numbers whose difference is 2. For e.g. 3,5; 11,13; 17, 19; etc. We can use IsPrime function to count how many pair primes are there in a range from 2 to 100 for example. Create a function pairPrime, that takes one argument. pairPrime should return the number of pair primes between 2 and the argument passed. Use the pairPrime function to count the pair primes between 2 and 1000. Make use of the IsPrime function to solve this task. (This feature is worth 8 points). Use the compile/run button to test tour program. Include the output displayed. It will be similar to: command>javac…Please use JAVA GRAPHICS to create a card game in which the dealer shuffles the deck and deals 13 cards to the player. The player sorts her hand and says whether it includes the King of Hearts. Repeat 4 times so all the cards are dealt eventually. Internally, the player should return true or false without writing to the console. In response, the dealer should write on the console, "You won!" or "You loose again."
- Write a code in Java Programming Your task is to simulate a coffee shop using the observer pattern (do not use the deprecate one). The coffee shop serves two types of coffee: espresso and cappuccino. The shop has two baristas, EspressoBarista and CappuccinoBarista. EspressoBarista generates random espresso orders between 1 and 3 every 2 seconds, while CappuccinoBarista generates random cappuccino orders between 1 and 3 every 3 seconds. The UML design diagram is shown below. Property ChangeListenerfac Observablenerfacto Coffeeshop HashMap Sting, integer> ingredients ExpresssCartate The CoffeeShop class holds the current stock of ingredients and the CoffeeShop constructor initializes the count for each ingredient. The required ingredients for each type of coffee are as follows: • Espresso: 1 shot of espresso, 1 ounce of milk Cappuccino: 1 shot of espresso, 2 ounces of milk, 1 ounce of foam If an order cannot be fulfilled because there are not enough ingredients, a warning message…Given a list of integers, you want to know whether it is possible to divide the integers into two sets, so that the sums of the two sets are the same. Every integer must be in one set or the other. Write a recursive helper method that takes any number of arguments you like, and make the initial call to your recursive helper method from equalSum(). Do not use any loops or regular expressions. Test case 1: equalSum([2, 3, 5]) true Test case 2: equalSum([2, 2, 5]) falseHow can I express the following situation in Java programming? Orcs, Hobbits, and Tom Bombadil We have n-1 Orcs and n Hobbits who want to cross a river. We also have Tom Bombadil who wants to cross as well. Only Hobbits and Tom Bombadil can row the boat (don’t ask me why!) At all times, the number of Hobbits on either side of the river must be greater or equal the number of Orcs on that side (unless there are no Hobbits on that side), or the Hobbits will be killed by the Orcs! If the boat holds 2, with n=4 or more, the problem has no solution. If the boat can hold 3, then up to n=5 can be solved. If the boat can hold 4, any number (n) Hobbits can cross. So -- if n = 1,2 or 3 - use a boat of size 2. If n = 4 or 5 - use a boat of size 3. If n > 5 use a boat of size 4. If n <0 invalid input if n = 0 no output.