CS010 Practice 6

Simple Arithmetic Operators and Floating Point Data

 
  1. Write a program to implement a simple calculator. Your program should read in expressions like "7.3+8.5" and print out the answer, in this case "15.8". Your program should implement addition (+), subtraction (-), multiplication (*), and division (/). It should use double precision floating point values.
  2. Write a small program to determine if structures passed as function arguments are copied like simple data types or if a pointer is passed. Hint: see if the copy of the structure in the calling program is changed when you change its value inside the function.