CS 173 Introduction to Computer Science II Spring 2019

Homework #0

Task

Do the following problems from your text:

  • (40 points) P-1.27. Valid operators are +, -, *, and / which all have their conventional meanings. Perform all calculations using variables of type double.
    • Loop until you see no more input (hasNext() is false), performing the following
      • Read a double from the user
      • read an operator (as a String) from the user (consider using the trim() method of String)
      • read a second double from the user
      • perform the resulting calculation
      • output the result

Deliverables

Send your code for the above problems as an attachment to an email to me.

References


Copyright © 2019, David A. Reimann. All rights reserved.