Question

In: Computer Science

Please use Java Eclipse and show code/output Please create a program that determines when a good...

Please use Java Eclipse and show code/output

Please create a program that determines when a good day to go to the beach is.

Please use the users input and its returning output.

If the weather is 70 degree or greater, the program should say yes it is a good day to go

If the weather is less than 70 degrees to say no the weather is not a good day to go

Solutions

Expert Solution


import java.util.Scanner;

public class GoodDay {

        public static void main(String[] args) {
                
                Scanner sc = new Scanner(System.in);
                
                System.out.print("Enter the temperature : ");
                float temp = sc.nextFloat();
                if(temp >= 70) {
                        System.out.println("Yes, It is a Good day to go !");
                }else {
                        System.out.println("No, the weather is not a good day to go");
                }
                
                sc.close();

        }

}

Code

Output

Testcase #1

Testcase #2


Related Solutions

Please create a Java Eclipse code and show output and explanation. MUST USE EXCEPTION! Step 1....
Please create a Java Eclipse code and show output and explanation. MUST USE EXCEPTION! Step 1. Ask users how much money was spent on an orange. Step 2. Then ask the user how many oranges they purchased Step 3. Lastly calculate the price for each orange purchased.
PLZ USE ECLIPSE JAVA and show output with explanation The object of this assignment is to...
PLZ USE ECLIPSE JAVA and show output with explanation The object of this assignment is to construct a mini-banking system that helps us manage banking data. Notice that you can copy and paste your code from previous assignments. This assignment asks you to allow read from/write to file, as well as search and sorting algorithm. The object of this assignment is to construct a mini-banking system that helps us manage banking data. This assignment asks you to allow read from/write...
This question is about java program. Please show the output and the detail code and comment...
This question is about java program. Please show the output and the detail code and comment of the each question and each Class and interface. And the output (the test mthod )must be all the true! Thank you! Question1 Create a class Animal with the following UML specification: +-----------------------+ | Animal | +-----------------------+ | - name: String | +-----------------------+ | + Animal(String name) | | + getName(): String | | + getLegs(): int | | + canFly(): boolean | |...
When I wrote this code in the Eclipse program, I did not see a output .....
When I wrote this code in the Eclipse program, I did not see a output .. Why? _______ public class AClass { private int u ; private int v ; public void print(){ } public void set ( int x , int y ) { } public AClass { } public AClass ( int x , int y ) { } } class BClass extends AClass { private int w ; public void print() { System.out.println (" u + v...
Create a Java Program to show a savings account balance. using eclipse IDE This can be...
Create a Java Program to show a savings account balance. using eclipse IDE This can be done in the main() method. Create an int variable named currentBalance and assign it the value of 0. Create an int variable named amountToSaveEachMonth. Prompt "Enter amount to save each month:" and assign the result to the int variable in step 2. Create an int variable name numberOfMonthsToSave. Prompt "Enter the number of months to save:" and store the input value into the variable...
Create a JAVA code program: Huffman code will be converted to its text equivalent Output an...
Create a JAVA code program: Huffman code will be converted to its text equivalent Output an error message if the input cannot be converted I can give an thumbs up! :)
JAVA CODE, USE FOR LOOP PLEASE Using the PurchaseDemo program and output as your guide, write...
JAVA CODE, USE FOR LOOP PLEASE Using the PurchaseDemo program and output as your guide, write a program that uses the Purchase class to set the following prices, and buy the number of items as indicated. Calculate the subtotals and total bill called total. Using the writeOutput() method display the subtotals as they are generated as in the PurchaseDemo program. Then print the total bill at the end Use the readInput() method for the following input data Oranges: 10 for...
In java run through eclipse /**    *    * Given a square array, determines if...
In java run through eclipse /**    *    * Given a square array, determines if it is diagonal    * That is, returns true if all values in the array are 0    * except the main diagonal. The main diagonal is entries of the form    * data[i][j] where i == j. Elements on the main    * diagonal can be 0 or any other number.    *    * Examples:    * {{1,0,0},    * {0,2,0}   ...
NEED IN JAVA ECLIPSE For this lab, you will create a program that uses method overloading...
NEED IN JAVA ECLIPSE For this lab, you will create a program that uses method overloading and a switch statement. Requirements: The Patapsco River Valley Running Festival needs a program that will allow them to calculate the cost of the entry fee for each group of entrants. Once the cost is calculated, it is then displayed to the user. The program also totals up the total amount of money that will be collected and displays the total at the very...
This problem is about java program and please show the detail comment and code in each...
This problem is about java program and please show the detail comment and code in each class. Thank you! Create four classes with the following UML diagrams: (The "-" means private and the testBankAccount() testMobilePhone() testChocolate() testStudent() all static +-----------------------------+ | BankAccount | +-----------------------------+ | - money: int | +-----------------------------+ | + BankAccount(int money) | | + getMoney(): int | | + setMoney(int money): void | | + testBankAccount(): void | +-----------------------------+ +------------------------------------------------+ | MobilePhone     | +------------------------------------------------+ | -...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT