Preview

Java Calculator CMD

Satisfactory Essays
Open Document
Open Document
889 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Java Calculator CMD
import java.util.*;

class pup
{
public static void main (String [] args)
{
int a,b,op; int c = 0;
Scanner fSC = new Scanner(System.in);

System.out.println("Welcome to CMD basic calculator!\n"+"Press ENTER key to continue . . .");
Scanner aKey = new Scanner(System.in);
String akeyp = aKey.nextLine();

System.out.println("Enter first number:"); a = fSC.nextInt();

System.out.println("Input operator to be used( Ex. 1):\n"+"1. Addition\n"+"2. Subtraction\n"+"3. Multiplication\n"+"4. Division"); op = fSC.nextInt();

System.out.println("Enter second number:"); b = fSC.nextInt();

if (op==1) { c = a+b; } else if (op==2) { c = a-b;} else if (op==3) { c = a*b;} else if (op==4) { c = a/b; } else {
System.out.println("You have entered a wrong operator value !");
System.exit(0);
}
System.out.println("The Answer is "+c);
}
}

import java.util.*;

class pup
{
public static void main (String [] args)
{
int a,b,op; int c = 0;
Scanner fSC = new Scanner(System.in);

System.out.println("Welcome to CMD basic calculator!\n"+"Press ENTER key to continue . . .");
Scanner aKey = new Scanner(System.in);
String akeyp = aKey.nextLine();

System.out.println("Enter first number:"); a = fSC.nextInt();

System.out.println("Input operator to be used( Ex. 1):\n"+"1. Addition\n"+"2. Subtraction\n"+"3. Multiplication\n"+"4. Division"); op = fSC.nextInt();

System.out.println("Enter second number:"); b = fSC.nextInt();

if (op==1) { c = a+b; } else if (op==2) { c = a-b;} else if (op==3) { c = a*b;} else if (op==4) { c = a/b; } else {
System.out.println("You have entered a wrong operator value !");
System.exit(0);
}
System.out.println("The Answer is "+c);
}
}

import java.util.*;

class pup
{
public static void main (String [] args)
{
int a,b,op; int c = 0;
Scanner fSC = new Scanner(System.in);

System.out.println("Welcome to CMD basic calculator!\n"+"Press ENTER key to continue . . .");
Scanner aKey =

You May Also Find These Documents Helpful

  • Satisfactory Essays

    cout << "Select the operator you want to work (+ for addition, - for subtraction , * for multiplication , / for division):- ";…

    • 426 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    JDT2 Task 1

    • 1672 Words
    • 6 Pages

    Title VII of the Civil Rights Act of 1964 protects employees from workplace discrimination on the basis of race, color, religion, sex and national origin. When an employer engages in practices that create a hostile work environment for any of these protected groups, making conditions so intolerable that an employee feels compelled to resign, it is known as constructive discharge Former employee Andy Anderson now alleges that our company engaged in religious discrimination when our production schedule changes went into effect at the first of the year. The changes required all production employees to occasionally work on a religious holy day, and Mr. Anderson has submitted a constructive discharge claim with the U.S. Equal Employment Opportunity Commission (EEOC).…

    • 1672 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    JDT2 Task 3

    • 2402 Words
    • 8 Pages

    Higher employee satisfaction – When an appraisal is exquisitely prepared and well delivered employees are prone to respond better to the feedback presented. The employees also come away from the meeting with a clear understanding of their performance and where improvement is needed. They will also have good understanding of the company’s goals both for itself and for the employee themselves.…

    • 2402 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    Allscripts Step by Step

    • 430 Words
    • 2 Pages

    4. Verify the action is Send to Retail and the Pharmacy is correct. Select a different action when appropriate (Call Rx, Print Rx, Send to Mail Order).…

    • 430 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    JNT2 Task 1

    • 1417 Words
    • 6 Pages

    The City of Houston currently finds itself in quite a quandary. With a looming budget deficit of nearly $142 million dollars, city leaders have asked employees to begin to re-engineer work processes, cut costs wherever possible and eliminate unnecessary spending. While departments have all been mandated to cut 1% of their total budget for the next fiscal year, there still lies the issue of employees streamlining their work processes in order to eliminate any unnecessary waste.…

    • 1417 Words
    • 6 Pages
    Better Essays
  • Satisfactory Essays

    Cj511 Assignment 3

    • 590 Words
    • 3 Pages

    3c. The same pattern of findings is observed in Table 7 and Table 5. Accordingly, there is a generalized correlation between delinquency measures and high-order personalities by sex in Table 5 and by race in Table…

    • 590 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    5.A. 5463 divided by 9= 607. Multiply 607 by 9 to check your answer. B. 6.00-3.98= 2.02 C. 5.70x0.03= .1710 I moved the decimal over 4 places. D. 4 1/2 divided by 6= 9/12 or ¾. E. 18 1/5-12 2/3= 5 8/15 I found a common denominator. F. 25.75+40.00= 65.75 G. 546.30 divided by .09 move the decimal over two to the right and you get 6070 as your answer. H. 6 divided by 4 ½ flip the second fraction and you get 1 1/3 as the answer. I. 13 7/8+6 1/3 find a common denom as 24 to get 20 5/24 as the answer. J. 8 2/5x1 5/7= 14 2/5 as the answer.…

    • 347 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    IT Level 3

    • 1133 Words
    • 6 Pages

    The program tells us how to multiply the numbers that are put above, e.g. found coins = 20, magic coins =10 and stolen coins=3 which are from lines 1-3 and line4 shows us a question which consists of those numbers. Line 5 shows us that stolen coins value is now 2 instead of 3 and line7 shows us that magic coins has also changed its value from 10 to 13…

    • 1133 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    Pivot Calculator

    • 1213 Words
    • 5 Pages

    Most experienced traders will be able to tell many stories about how certain price levels tend to prevent traders from pushing the price of an underlying asset in a certain direction. For example, assume that Jim was holding a position in Amazon.com (AMZN) stock between March and November 2006 and that he was expecting the value of the shares to increase. Let's imagine that Jim notices that the price fails to get above $39 several times over the past several months, even though it has gotten very close to moving above it. In this case, traders would call the price level near $39 a level of resistance. As you can see from the chart below, resistance levels are also regarded as a ceiling because these price levels prevent the market from moving prices upward.…

    • 1213 Words
    • 5 Pages
    Good Essays
  • Better Essays

    Enter the interest rate of your investment, divided by the number of times per year you expect to owe payments. For example, if you can get an interest rate of 6 percent on a car loan paid back monthly, enter ".06/12" (without the quotations) in the rate section of the formula. Type a comma to move to the next section of the formula.…

    • 2320 Words
    • 10 Pages
    Better Essays
  • Good Essays

    Discreate Math Solution

    • 1136 Words
    • 5 Pages

    Bob and Thelma Mellankamp had often dreamed of starting their own business. As college students in the 1970s while on their way to an economics class, Bob and Thelma drove by Myrtle’s Family Restaurant and noticed a “for sale” sign in the window. Bob and Thelma realized that their dream could come true if they purchased the restaurant. After making arrangements to purchase the business, Hoosier Burger Restaurant was born. This is a medium sized restaurant that still does business the same way it did when it originally opened; all paperwork is done by hand. Thelma and Bob need the benefits of purchasing a computer system. Bob needs to learn about alternative practices and looks into hiring a consultant.…

    • 1136 Words
    • 5 Pages
    Good Essays
  • Good Essays

    payroll calculator

    • 946 Words
    • 7 Pages

    So mother as you know tomorrow is a very big day… (mother gothel is looking at the mirror and stretching her face)…

    • 946 Words
    • 7 Pages
    Good Essays
  • Good Essays

    Math Math Go Away

    • 475 Words
    • 2 Pages

    “Once I get into algebra, my parents will have to help me with my homework.”…

    • 475 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Math

    • 3083 Words
    • 13 Pages

    Choosing this project to use as my final presentation was based off of a moral decision to use this class to its full potential. I came into TCXG 464 with the idea of an open mind towards teaching but also having a gut instinct that writing was my passion and teaching was more of a learned science. Yet, as I entered the school for my observation I began to get cold feet about the whole idea of passing on the idea of analyzing a writing text book.…

    • 3083 Words
    • 13 Pages
    Powerful Essays
  • Satisfactory Essays

    math

    • 493 Words
    • 2 Pages

    1. This article is a primary source. The author Harry Harlow is the researcher amongst some of his colleagues who conducted the experiment.…

    • 493 Words
    • 2 Pages
    Satisfactory Essays

Related Topics