Write a program that first ask the user to enter real number

Assignment Help Computer Engineering
Reference no: EM132170648

Using Java. Using Eclipse, write a program that first asks the user to enter three real numbers using GUI input.

Print the sum if all three numbers are positive, print the product of the two positive numbers if only one is negative - use one nested if.

Then, ask the user to enter two real numbers from the console. If both numbers are negative, print the quotient.

All output should be to a dialog and the console - console output must done using printf and format specifiers. Use meaningful vaiable names, infomative prompts and label output.

Write a method getFloat to ask for the real numbers. Good program structure, indentation, a heading and comments are required.

Something similar to this format.

import java.util.Scanner;

public class Example3 {

public static getInt(){

String strnum = JOptionPane.showinputDialog("Enter a real number");

return Integer.parseInt(strnum);

public static void main(String args[]){

Scanner input = new Scanner (System.in);

System.out.println("Enter real numbers");

ect. ect... if statements.. else if statement.

Reference no: EM132170648

Questions Cloud

Write a javascript function which accepts an argument : Write a JavaScript function which accepts an argument and returns the type. Output returned value to console.log(). Submit HTML with external JS file.
Using java write a class called temperature : Using JAVA Write a class called Temperature that has two instance variables: a temp value (a floating-point number - data type double) and a character.
Print the adjacency matrix of the graph : Implements Prim's algorithm for finding the minimum spanning tree of a weighted graph. Your program should conform to the following specifications.
Cost-reducing technological process : For each event below, explain if demand or supply would shift and in what direction. What would the effect be on equilibrium price and quantity?
Write a program that first ask the user to enter real number : Print the sum if all three numbers are positive, print the product of the two positive numbers if only one is negative - use one nested if.
Yield the maximum net benefits : Suppose total benefits and total costs are given by B(Y) = 100Y - 8Y2 and C(Y) = 10Y2. What level of Y will yield the maximum net benefits?
What is the net present value of purchasing the tractor : The tractor costs $9,000 today, while the above cost savings will be realized at the end of each year. If the interest rate is 7 percent.
Write a test program to declare and initialize two integer : Write a test program (main) to declare and initialize two integer arrays of size entered by the user, invoke the method logicAnd, then display the array result.
Demand for a good tends to be more inelastic when : Other things equal, the demand for a good tends to be more inelastic when?

Reviews

Write a Review

Computer Engineering Questions & Answers

  What could done to advance integrity of software profession

What could be done to advance integrity and reputation of the software profession? What are the obligations of a programmer/software engineer for CLIENT and EMPLOYER?

  Create your policy before procuring technology

Create your policy before procuring technology - Find the devices that are accessing corporate resources

  Design a minimum component circuit

The 68000 interrupt structure requires several external packages, if its full facilities are to be used. Suppose that only four interrupt levels are needed.

  How security and integrity of their data can be maintained

The advantages and disadvantages to an organisation of using Cloud Computing, for example, the potential to reducecosts, the risk of making the organisation's data more vulnerable to hacking.

  Why does every unix system have -etc-profile

Why does every UNIX system have /etc/profile? When is this file executed? A shell script also runs the login file. True or false?

  Compare and contrast phases steps techniques and deliverable

Compare and contrast phases, steps, techniques, and deliverables. What are the six general skills all project team members should have?

  Write a program which simulates a forest fire

Write a program which simulates a forest fire on a 12 x 12 matrix. You will model the effects of the fire from it's inception until it burns out.

  How many words are required for virtual memory

A system has a virtual memory space of 8 virtual pages for a process with 8 blocks per page and 4 words per block. The main memory consists of 4 page frames with 4 blocks per page and 8 words per block. How many words are required for virtual memo..

  In a sample of 1500 widgets it is found that 679 are

the quality control department of widgets manufacturing needs your help. they cant decide which significance level is

  Vulnerabilities in purchasing through debit card

Recognize any potential vulnerabilities in act of making a purchase through the debit card, and which area of the CIA triad they apply to.

  Method to obtain approximate values of the solution

Use Euler's Method to obtain approximate values of the solution at x = 0.5, 1, 1.5, and 2 and compare your numerical solutions with the exact solution found.

  Suppose the memory cells at addresses 20 through 28 in the

suppose the memory cells at addresses 20 through 28 in the machine contain the following bit patternsaddress contents

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd