Write a program that reads a value representing a number of seconds and returns the equivalent amount of time in days, hours, minutes, and seconds.

Here’s my solution for it:

Anything related to game development, game logic and coding.

Write a program that reads a value representing a number of seconds and returns the equivalent amount of time in days, hours, minutes, and seconds.

Here’s my solution for it:

The equation of a line is given as: y = mx +c. Write a program that asks the user for the start and end points of a line and calculates values for m and c:

m = The slope of the line (y2 – y1) / (x2 – x1)

c = The intercept (where the line intersects the y axis (i.e. Where x = 0)

Here’s my solution for it:

Continue reading

So I thought I’d upload some of the C# Object Oriented Programming labs I was given in my Computer Games studies and my solutions for them. Here’s the first one:

**Lab1**

Create a Windows Console application, with a number of variables:

a, b c (floats)

x1 and x2 (floats)

hasRoots (boolean)

The purpose of the program is to calculate the roots of the quadratic equation using the quadratic formula:

Here’s my solution for it: