2. Write a Java program that do the Following: (6 Marks) Asks the user to enter...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. Write a Java program that do the Following: (6 Marks) Asks the user to enter the name of your department using Scanner and asks you to enter three numbers of the type double named x, y, and z, use Scanner. The program should find the smallest number and use it to calculate the following expression: expr = smallest + 39 2+1* (smallest 2) 2 Use print statement to print the department name, the smallest number, and the result of the expression. Each in a separate line. 2. Write a Java program that do the Following: (6 Marks) Asks the user to enter the name of your department using Scanner and asks you to enter three numbers of the type double named x, y, and z, use Scanner. The program should find the smallest number and use it to calculate the following expression: expr = smallest + 39 2+1* (smallest 2) 2 Use print statement to print the department name, the smallest number, and the result of the expression. Each in a separate line.
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class DepartmentCalculator ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Barry consumes tacos and pepsi. The price of tacos is initially $4.00 per taco and the price of pepsi is $1.00 per can and Bary has $20.00 to spend. The marginal utility that each good yields is...
-
A linear programming problem contains a restriction that reads "the quantity of X must be at least twice as large as the quantity of Y." Formulate this as a linear programming constraint.
-
What impact would the following actions have on the operating and cash conversion cycle s? Would the cycles increase, decrease, or remain unchanged? a. Less raw material than usual is purchased. b....
-
Consider a simple bivariate VECM \[ \begin{aligned} & y_{1 t}-y_{1 t-1}=\delta_{1}+\alpha_{1}\left(y_{2 t-1}-\beta y_{1 t-1}-\mu ight) \\ & y_{2 t}-y_{2 t-1}=\delta_{2}+\alpha_{2}\left(y_{2...
-
Fabulous Fragrances makes two products: lotion and shampoo. Actual and expected revenue data for the two products are as follows: Using the above data, compute the sales price and sales volume...
-
Catch Exception The method divideValues() will throw an IllegalArgumentException if either parameter is 5. The method below takes two integer values as parameters and calls divideValues() in a try...
-
The financial statements of Tarbet Township contain the following data regarding financial position: Governmental fund balances $ 5,000,000 Capital assets used in governmental activities $2,375,000...
-
You have a Customer class with a public String field size. In your program's main method, you create a Customer instance c1. How could you consolidate this switch statement, which is used to set...
-
What is stakeholder analysis? Explain the steps taken to achieve the identification and evaluation.
-
How is Porters five force framework related to the identification of key success factors?
-
How does the resource-based view of firms help in determining the sustainability of a competitive advantage?
-
Explain why environmental analysis is considered to be an important activity for the strategy formulation process of an organization.
-
How do corporations analyze the societal environment? Is STEEP Analysis an appropriate tool?
-
Does a reaction occur when aqueous solutions of potassium acetate and sodium carbonate are combined? Oyes Ono If a reaction does occur, write the net ionic equation. Use the solubility rules provided...
-
You are standing on the top of a building and throw a ball vertically upward. After 2 seconds, the ball passes you on the way down, and 2 seconds after that, it hits the ground below. a. What is the...
-
Write a program that generates a sequence of 20 random values between 0 and 99 in an array, prints the sequence, sorts it, and prints the sorted sequence. Use the sort method from the standard Java...
-
Change the public interface of the circuit class of Exercise E8.3 so that it has the following methods: public int getSwitchState(int switchNum) public int getLampState() public void toggleSwitch(int...
-
How would you modify the drawItalianFlag method in How To 10.1 to draw any flag with a white vertical stripe in the middle and two arbitrary colors to the left and right?
-
Investigate if the W250 \(\times 58\) shape section can safely support the loading acting on the overhanging beam. The beam is made from steel having an allowable normal stress of \(\sigma_{\text...
-
The brick wall exerts a uniform distributed load of \(1.20 \mathrm{kip} / \mathrm{ft}\) on the beam. If the allowable bending stress is \(\sigma_{\text {allow }}=22 \mathrm{ksi}\) and the allowable...
-
The joists of a floor in a warehouse are to be selected using square timber beams made of oak. If each beam is to be designed to carry \(90 \mathrm{lb} / \mathrm{ft}\) over a simply supported span of...
Study smarter with the SolutionInn App