Question

In: Computer Science

PLEASE USE THE FLOWORITHM APPLICATION FOR THE ANSWER . I need that not a flowchart .Design...

PLEASE USE THE FLOWORITHM APPLICATION FOR THE ANSWER . I need that not a flowchart .Design the logic for a program that takes in three numbers from the user. Find the largest of the three numbers and output the largest number.

Solutions

Expert Solution

Greetings !

Logic to find the largest among three numbers:

if (first >= second) {

        if (first >= third)

            print(" first is the largest number");

        else

            print(" third is the largest number");

    } else {

        if (second >= third)

            print(" second is the largest number");

        else

            print(" third is the largest number");

    }

// Implementation of above logic in flowgorithm

screenshot of the output:

Pseudocode of the algorithm generated by flowgorithm application:

Function Main

    Declare Integer first

    Declare Integer second

    Declare Integer third

    Output "Enter first number"

    Input first

    Output "Enter second number"

    Input second

    Output "Enter third number"

    Input third

    If first > second

        If first > third

            Output first & " is the largest number"

        False:

            Output third & " is the largest number"

        End

    False:

        If second > third

            Output second & " is the largest number"

        False:

            Output third & " is the largest number"

        End

    End

End

Java cource code generated by flowgorithm application:

import java.util.*;

import java.lang.Math;

public class JavaApplication {

    private static Scanner input = new Scanner(System.in);

    public static void main(String[] args) {

        int first;

        int second;

        int third;

        System.out.println("Enter first number");

        first = input.nextInt();

        System.out.println("Enter second number");

        second = input.nextInt();

        System.out.println("Enter third number");

        third = input.nextInt();

        if (first > second) {

            if (first > third) {

                System.out.println(Integer.toString(first) + " is the largest number");

            } else {

                System.out.println(Integer.toString(third) + " is the largest number");

            }

        } else {

            if (second > third) {

                System.out.println(Integer.toString(second) + " is the largest number");

            } else {

                System.out.println(Integer.toString(third) + " is the largest number");

            }

        }

    }

}


Related Solutions

( i need Unique answer, don't copy and paste, please) (dont' use handwriting, please). (i need...
( i need Unique answer, don't copy and paste, please) (dont' use handwriting, please). (i need references URL Link) General Question ** How to perform logistic regression in SPSS?
( i need Unique answer, don't copy and paste, please) (dont' use handwriting, please) (i need...
( i need Unique answer, don't copy and paste, please) (dont' use handwriting, please) (i need your reference URL Link) 1. Discuss charismatic traits and behaviors of a leader. How a person can manage relationship in workplace? i need more explain ( i need Unique answer, please) *** Please i need Unique answer, if you don't have unique answer don't answer ***
( i need Unique answer, don't copy and paste, please) (dont' use handwriting, please) (i need...
( i need Unique answer, don't copy and paste, please) (dont' use handwriting, please) (i need your reference URL Link) 1. Discuss charismatic traits and behaviors of a leader. How a person can manage relationship in workplace? i need more explain ( i need Unique answer, please) *** Please i need Unique answer, if you don't have unique answer don't answer ***
( i need Unique answer, don't copy and paste, please) (dont' use handwriting, please) (i need...
( i need Unique answer, don't copy and paste, please) (dont' use handwriting, please) (i need your reference URL Link) 1. Discuss charismatic traits and behaviors of a leader. How a person can manage relationship in workplace? i need more explain ( i need Unique answer, please) *** Please i need Unique answer, if you don't have unique answer don't answer ***
DESIGN A FLOWCHART IN THE APPLICATION FLOWGORITHM Exercise called: Number Analysis Program Design a program that...
DESIGN A FLOWCHART IN THE APPLICATION FLOWGORITHM Exercise called: Number Analysis Program Design a program that asks the user to enter a maximum of 20 numbers. The program should store the numbers in an array and then display the following data: 1-The lowest number in the array. 2-The highest number in the array. 3-The total of the numbers in the array. 4-The average of the numbers in the array. PLEASE AND THANK YOU
I need a python program and a flowchart please!! Problem #1:    How much should I...
I need a python program and a flowchart please!! Problem #1:    How much should I study outside of class?                         Issue: Your fellow students need help. This is their first year in college and they need to determine how many hours they need to study to get good grades. Study Hours Per Week Per Class                    Grade 15                                                           A 12                                                           B 9                                                             C 6                                                             D 0                                                             F Project Specifications: The user enters their full name and the number of...
Please do not use Excel to answer this. I need the computations as we are not...
Please do not use Excel to answer this. I need the computations as we are not allowed to use excel. Sequential Method Jasmine Company manufactures both pesticide and liquid fertilizer, with each product manufactured in separate departments. Three support departments support the production departments: Power, General Factory, and Purchasing. Budgeted data on the five departments are as follows: Support Departments Producing Departments Power General Factory Purchasing Pesticide Liquid Fertilizer Overhead $80,000 $312,000    $165,000    $78,500 $107,400 Square feet 1,500...
-please answer this written out. Do not use excel I cannot access it. i need to...
-please answer this written out. Do not use excel I cannot access it. i need to know how to do it on paper- Deluxe River Cruises operates a fleet of river vessels. The fleet has two types of vessels: A type A vessel has 60 deluxe cabins and 160 standard cabins, whereas a type B vessel has 80 deluxe cabins and 120 standard cabins. Under a charter agreement with the Odyssey Travel Agency, Deluxe River Cruise sis to provide Odyssey...
please don't use handwriting .. use your own words i need unique answer .. please don't...
please don't use handwriting .. use your own words i need unique answer .. please don't copy and paste Q1.Dala Corporation is considering a project, which will involve the following cash inflows and (out) flows Details Amount Initial Outlay SAR (400000) After 1 Year SAR 40000 After 2 Years SAR 300000 After 3Years SAR 300000 What will be the NPV of this project if a discount rate of 15% is used? _________________ Q2.Merck Inc. is about to undertake a project...
please can you complete my answer .. Please, i need Unique answer, Use your own words...
please can you complete my answer .. Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use handwriting, Use your keyboard. Q1: 1. Explain with the help of suitable examples / graph the following:     a. ‘Production Possibility Curve’      b. The concept of ‘Opportunity Cost’      c. Distinguish between ‘Quantity Demanded’ and ‘Demand Schedule’ Answer : this is my answer i want you to complete my answer (with the help of suitable examples...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT