Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Create a Flowchart

//Java Source Code :-

import java.util.Scanner;
public class bExpert {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("\nVALUES");
System.out.print("Value 1: ");
int v1 = sc.nextInt();
System.out.print("Value 2: ");
int v2 = sc.nextInt();
System.out.print("Value 3: ");
int v3 = sc.nextInt();

System.out.println("\nPROCESS");
System.out.println("\n1. Summation");
System.out.println("2. Product");
System.out.println("3. Min / Max");
System.out.println("4. Odd / Even");

char st = 'y';

while(st != 'n'){
System.out.print("\nCHOICE: ");
int ch = sc.nextInt();
switch(ch) {

case 1:
int sum = v1 + v2 + v3;
System.out.println("\nSum = "+sum);
break;

case 2:
int prod = v1 * v2 * v3;
System.out.println("\nProduct = "+prod);
break;

case 3:
int max, min;
max=(v1>v2)?((v1>v3)?v1:v3):((v2>v3)?v2:v3);
min=(v1<v2)?((v1<v3)?v1:v3):((v2<v3)?v2:v3);
System.out.println("\nMax = "+max+"\nMin = "+min);
break;

case 4:
String res1 = v1%2 == 0 ? "Even" : "Odd";
String res2 = v2%2 == 0 ? "Even" : "Odd";
String res3 = v3%2 == 0 ? "Even" : "Odd";
System.out.println(v1 + " is: "+ res1);
System.out.println(v2 + " is: "+ res2);
System.out.println(v3 + " is: "+ res3);
break;

default :
System.out.println("\nInvalid Input!");
}
System.out.print("\nTry Again(y/n)?");
st = sc.next().charAt(0);
}
}
}
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
    SEE MORE QUESTIONS
    Recommended textbooks for you
    Text book image
    Database System Concepts
    Computer Science
    ISBN:9780078022159
    Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
    Publisher:McGraw-Hill Education
    Text book image
    Starting Out with Python (4th Edition)
    Computer Science
    ISBN:9780134444321
    Author:Tony Gaddis
    Publisher:PEARSON
    Text book image
    Digital Fundamentals (11th Edition)
    Computer Science
    ISBN:9780132737968
    Author:Thomas L. Floyd
    Publisher:PEARSON
    Text book image
    C How to Program (8th Edition)
    Computer Science
    ISBN:9780133976892
    Author:Paul J. Deitel, Harvey Deitel
    Publisher:PEARSON
    Text book image
    Database Systems: Design, Implementation, & Manag...
    Computer Science
    ISBN:9781337627900
    Author:Carlos Coronel, Steven Morris
    Publisher:Cengage Learning
    Text book image
    Programmable Logic Controllers
    Computer Science
    ISBN:9780073373843
    Author:Frank D. Petruzella
    Publisher:McGraw-Hill Education