iOS Development

Course No. 10-152-139

Assignment 3-1

  • Create a new Xcode project. Name it Assignment-3-1.
  • In the main.c file write a program that does the following.
    • Defines float variables for width, height, and depth of a possibly non-regular cube. (The sides might not all be the same size.)
    • Calculates the volume of the cube into a variable.
    • Calculates the surface area of the cube into a variable.
    • Calculates the perimeter of each of the three possibly different sides into variables.
    • Output the dimensions of the cube on one line.
    • Output all the calculations, each on their own line, each with its own printf statement.
    • Your output could look something like this.
  • Non-regular cubes can be many shapes.


  • Change the value of the variables for width, height, and depth and observe the output. How do you know your program is giving you the right output?
  • In a comment at the bottom of the program, describe how you verified that the calculations were correct.