-
Need some help
Don't know how to do this, looking for some ideas
A photoshop frames pictures as part of its business. All frames are one inch wide. The shop charges 25 cents for each inch of frame and 10 cents for each square inch of matting material. Write a program that takes the length of width of the picture as input and calculates the cost of framing the picture.
-
How would you do it on paper? That's the first step. Once you figure out how you'd do it yourself, then you can convert that algorithm into code.
Start the conversion one step at a time. First with an empty program, then maybe by asking for the length and width of the picture, then by doing one of the calculations, etc. Compile and test the code after each step to make sure you are moving in the right direction. If you have a specific question, then feel free to ask here.
-
What calculations would I have to do to get my cost?
-
Well, for a start:
Code:
parameter = (width + height) * 2;
area = width * height;
cost = (.25 * parameter) + (.10 * area);
Right?