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

    Homework Unit 3

    • 354 Words
    • 2 Pages

    4. AND operator- combines more than one condition in a program. Makes a compunf Boolean operation.…

    • 354 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    Display it on the next line in decimal and the user if he or she wants to do it. Again if the user type ‘y’ or ‘Y’ the program repeats. If the user type anything else the program terminates. If the user types an illegal character, prompt the user to type again. Page: 115…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nt1310 Unit 3 Assignment

    • 256 Words
    • 2 Pages

    Write a program to read the name of 5 students through keyboard and store them in a file “name.txt”.…

    • 256 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
  • 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

    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
  • 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