Jump to content

Just a program that calculates the surface area and volume of several(well, one in this version)3D objects. Just want some feedback on this program.

 

Code + EXE: https://github.com/GenesisOfTheVoid/C-.NET-Projects/tree/master/GeoCalc

Did my post help you? Then make sure to rate it!

Check out my post on symbolic links! || PSU ranking and tiers || Pokemon Thread

 

Link to comment
https://linustechtips.com/topic/384075-c-geometry-calculator/
Share on other sites

Link to post
Share on other sites

Suggestion:

Switch from buttons to radio buttons so you can select a specific object type and display all fill forms below, and answer at the bottom. This reduced the number of popups, improves usability. Quick sketch:

 

Can you elaborate a little more on how to do this?

Did my post help you? Then make sure to rate it!

Check out my post on symbolic links! || PSU ranking and tiers || Pokemon Thread

 

Link to comment
https://linustechtips.com/topic/384075-c-geometry-calculator/#findComment-5207418
Share on other sites

Link to post
Share on other sites

Lets start simple. Separate the UI code from the code that runs the calculations and organize your shapes in their own classes. Each shape (Cylinder, Sphere, Cube, etc) would get their own class.

public class Cylinder{    private int _radius;    private int _height;    public Cylinder(int radius, int height)    {        _radius = radius;        _height = height;    }    public double SurfaceArea()    {        // For you to complete    }    public double Volume()    {        // For you to complete    }}

Then your buttons would create and use the Cylinder object instead of doing the calculations directly. A task for you to complete.

 

*Note that your form class is also named Cylinder, so if you create a new class named Cylinder in that project it will conflict. I would rename the form to CylinderForm first.*

Link to comment
https://linustechtips.com/topic/384075-c-geometry-calculator/#findComment-5207689
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×